Advertisement
STANAANDREY

MAT_COMPL

May 13th, 2019
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int n,i,j,a[100][100],k,m,nr,ok,c;
  7. cout<<"n=";cin>>n;
  8. cout<<"m=";cin>>m;
  9. for (i=0;i<n;i++)
  10.     for (j=0;j<m;j++)
  11.      cin>>a[i][j];
  12.      cout<<endl;
  13. for (c=0;c<n-1;c++) {
  14. for (i=c+1;i<n;i++) {
  15.         ok=1;
  16.  for (j=0;j<m&&ok;j++)
  17.  {
  18.      if (a[i][j]+a[c][j]!=1)
  19.       ok=0;
  20.  }
  21.      if (ok)
  22.     cout<<c<<' '<<i<<endl;
  23. }
  24.  
  25. }
  26.   return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement