Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <stdio.h>
  3. #include <iostream>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. freopen ("Input.txt", "r", stdin);
  11. freopen ("Output.txt", "w", stdout);
  12. int n,m,a[110][110],ans=0,b[10010][2],k=0;
  13. cin>>n;
  14. for(int i=0;i<n;i++){
  15. for(int j=0;j<n;j++){
  16. cin>>a[i][j];
  17. if(a[i][j]==1){
  18. ans++;
  19. b[k][0]=i+1;
  20. b[k][1]=j+1;
  21. k++;
  22. }
  23. }
  24. }
  25. cout<<n<<' '<<ans<<'\n';
  26. for(int i=0;i<ans;i++){
  27. cout<<b[i][0]<<' '<<b[i][1]<<'\n';
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement