Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a[100][100];
- int n, m;
- int b[100];
- cin >> n >> m;
- for (int i = 0; i < n; i++)
- for (int j = 0; j < m; j++)
- cin >> a[i][j];
- for (int i = 0; i < n; i++) {
- int temp = 0;
- for (int j = 0; j < m / 2; j++)
- if (a[i][j] == a[i][m - j - 1])
- temp++;
- else
- break;
- if (temp == m / 2)
- b[i] = 1;
- else
- b[i] = 0;
- }
- for (int i = 0; i < n; i++)
- cout << b[i] << " ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement