Advertisement
Guest User

sa

a guest
Jan 22nd, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.75 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. main(){
  4.  
  5. int C[5][5];
  6. bool B[5][5];
  7. int temporanea=0;
  8. int k=0;
  9. int f=0;
  10. int z=0;
  11. int w=0;
  12. bool diverso=false;
  13. int n=0;
  14. bool confronto[25];
  15. int tempR[25];
  16. int tempC[25];
  17.  
  18. for(int i=0; i<5; i=i+1){
  19.     for(int j=0; j<5; j=j+1){
  20.         cin>>C[i][j];
  21.     }
  22. }
  23.  
  24. for(int i=0; i<5; i=i+1){
  25.     for(int j=0; j<5; j=j+1){
  26.         tempR[k]=C[i][j];
  27.         k=k+1;
  28.     }
  29. }
  30.  
  31. for(int j=0; j<5; j=j+1){
  32.     for(int i=0; i<5; i=i+1){
  33.         tempC[f]=C[i][j];
  34.         f=f+1;
  35.     }
  36. }
  37.  
  38. for(int z=0;z<5;z=z+1){
  39.     for(int w=0;w<5;w=w+1){
  40.         for(int l=0;l<5;l=l+1){
  41.             if(tempR[n+l]!=tempC[n+l]){
  42.                 diverso=true;
  43.             }
  44.         }
  45.         n=n+5;
  46.         cout<<n<<endl;
  47.         if(diverso){
  48.             B[z][w]=false;
  49.         }else{
  50.             B[z][w]=true;
  51.         }    
  52.     }
  53. }
  54.  
  55. for(int i=0;i<5;i=i+1){
  56.     for(int j=0;j<5;j=j+1){
  57.         cout<<B[i][j];
  58.     }
  59.    cout<<endl;
  60. }
  61.  
  62. /*
  63.  
  64. for(int i=n;i<n+5;i=i+1){
  65.     if(tempR[i]==tempC[i]){
  66.         confronto[i]=true;
  67.     }else{
  68.         confronto[i]=false;
  69.     }
  70. }
  71.    
  72. for(int j=0;j<lung;j=j+1){
  73.     //cout<<confronto[j]<<" ";
  74. }
  75.  
  76. for(int i=0;i<5;i=i+1){
  77.     for(int j=0;j<5;j=j+1){
  78.         if(diverso){
  79.             B[i][j]=false;
  80.         }else{
  81.             B[i][j]=true;
  82.         }
  83.     }
  84. }
  85.  
  86. for(int i=0;i<5;i=i+1){
  87.     for(int j=0;j<5;j=j+1){
  88.         //cout<<B[i][j];
  89.     }
  90.    // cout<<endl;
  91. }
  92. */
  93.  
  94.  
  95. /*
  96. for(int l=0;l<5;l++){
  97.     for(int k=0;k<5;k++){
  98.         cout<<B[l][k]<<endl;
  99.     }
  100. }
  101.   //da fare
  102.    
  103.   for(int i=0; i<5; i=i+1)
  104.   {
  105.     cout<<"riga="<<i<<':';
  106.     for(int j=0; j<5; j=j+1)
  107.       cout<<B[i][j]<<' ';  
  108.     cout<<endl;
  109.    } */
  110.  cout<<"end"<<endl;  
  111.    
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement