Dec 10, 2013 at 7:51am UTC
int count=0;
for(i=0; i<size; i++){
for(j=0; j<size; j++){
if(x[i][j] == y[i][j]){
count++;
continue;
}
else
break;}
}
if(count==9)
cout << "Idempotent";
any simple method to check this two matrix?
Please help me
Thank you
Last edited on Dec 10, 2013 at 11:46am UTC
Dec 10, 2013 at 8:10am UTC
#include<iostream>
#include<conio.h>
#define size 3
using namespace std;
void main(){
int a[3][3]={{2,3,4} , {1,2,3}, {4,5.6}};
int b[3][3]= {{2,3,4} , {1,2,3}, {4,5.6}};
bool check (int [][3], int [][3]);
_getch;
}
bool check(int c[][3], int d[][3])
{
bool flag = 0;
for(int i = 0; i < 3; i++)
for(int j=0; j<3; j++) {
if(c[i][j] == d[i][j])
flag = 1;
}
return flag;
}
Dec 10, 2013 at 8:10am UTC
If i want to use flag,how to use?
What to change in this program
Dec 10, 2013 at 3:24pm UTC
but if it is not identical,it still cout identical
Dec 10, 2013 at 4:12pm UTC
Thank you very much,you help me a lot.