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