Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- int main() {
- int c = 0;
- int a;
- std::cin>>a;
- int map[a][a];
- std::vector<std::pair<int, int>> pairs;
- for (int x = 0; x < a; x++)
- for (int y = 0; y < a; y++)
- std::cin>>map[x][y];
- for (int x = 0; x < a; x++)
- for (int y = 0; y < x; y++)
- if (map[x][y])
- pairs.push_back(std::pair<int,int>(y+1, x+1));
- for (int x = 0; x < pairs.size(); x++)
- std::cout<<pairs[x].first << " " << pairs[x].second << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement