Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <stdio.h>
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- freopen ("Input.txt", "r", stdin);
- freopen ("Output.txt", "w", stdout);
- int n,m,a[110][110],ans=0,b[10010][2],k=0;
- cin>>n;
- for(int i=0;i<n;i++){
- for(int j=0;j<n;j++){
- cin>>a[i][j];
- if(a[i][j]==1){
- ans++;
- b[k][0]=i+1;
- b[k][1]=j+1;
- k++;
- }
- }
- }
- cout<<n<<' '<<ans<<'\n';
- for(int i=0;i<ans;i++){
- cout<<b[i][0]<<' '<<b[i][1]<<'\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement