1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <iostream> using namespace std; int main() { int N = 0, v = 0, count = 0; int* arr; cin >> N; arr = new int[N]; for (int i = 0; i < N; i++) { cin >> arr[i]; } cin >> v; for (int i = 0; i < N; i++) { if (arr[i] == v) { count++; } } cout << count; return 0; } | cs |