Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <locale>
- using namespace std;
- int main() {
- int n, m, x, count = 0;
- bool check;
- cin >> n >> m >> x;
- int** arr = new int*[n];
- for (int i = 0; i < n; i++)
- {
- arr[i] = new int[m];
- check = false;
- for (int j = 0; j < m; j++)
- {
- cin >> arr[i][j];
- if (arr[i][j] == x && !check)
- {
- count++;
- check = true;
- }
- }
- }
- cout << count;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement