Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- main(){
- int C[5][5];
- bool B[5][5];
- int temporanea=0;
- int k=0;
- int f=0;
- int z=0;
- int w=0;
- bool diverso=false;
- int n=0;
- bool confronto[25];
- int tempR[25];
- int tempC[25];
- for(int i=0; i<5; i=i+1){
- for(int j=0; j<5; j=j+1){
- cin>>C[i][j];
- }
- }
- for(int i=0; i<5; i=i+1){
- for(int j=0; j<5; j=j+1){
- tempR[k]=C[i][j];
- k=k+1;
- }
- }
- for(int j=0; j<5; j=j+1){
- for(int i=0; i<5; i=i+1){
- tempC[f]=C[i][j];
- f=f+1;
- }
- }
- for(int z=0;z<5;z=z+1){
- for(int w=0;w<5;w=w+1){
- for(int l=0;l<5;l=l+1){
- if(tempR[n+l]!=tempC[n+l]){
- diverso=true;
- }
- }
- n=n+5;
- cout<<n<<endl;
- if(diverso){
- B[z][w]=false;
- }else{
- B[z][w]=true;
- }
- }
- }
- for(int i=0;i<5;i=i+1){
- for(int j=0;j<5;j=j+1){
- cout<<B[i][j];
- }
- cout<<endl;
- }
- /*
- for(int i=n;i<n+5;i=i+1){
- if(tempR[i]==tempC[i]){
- confronto[i]=true;
- }else{
- confronto[i]=false;
- }
- }
- for(int j=0;j<lung;j=j+1){
- //cout<<confronto[j]<<" ";
- }
- for(int i=0;i<5;i=i+1){
- for(int j=0;j<5;j=j+1){
- if(diverso){
- B[i][j]=false;
- }else{
- B[i][j]=true;
- }
- }
- }
- for(int i=0;i<5;i=i+1){
- for(int j=0;j<5;j=j+1){
- //cout<<B[i][j];
- }
- // cout<<endl;
- }
- */
- /*
- for(int l=0;l<5;l++){
- for(int k=0;k<5;k++){
- cout<<B[l][k]<<endl;
- }
- }
- //da fare
- for(int i=0; i<5; i=i+1)
- {
- cout<<"riga="<<i<<':';
- for(int j=0; j<5; j=j+1)
- cout<<B[i][j]<<' ';
- cout<<endl;
- } */
- cout<<"end"<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement