Home > Back-end >  The two arrays are equal
The two arrays are equal

Time:04-24

Why the same function return value is always 1
Beg bosses give directions!

CodePudding user response:

What is your idea? Your function is to determine a and b are equal? Why do a [I]==a [j].

CodePudding user response:

Reference:
 bool same (int a [], int [] b, int n)//equal length, are equal in each position of the element 
{
int i;
for(i=0; iIf (a [I]! [I]=b) return false;
}
return true;
}

CodePudding user response:

reference 1/f, the truth is more important than right or wrong response:
what is your idea? Your function is to determine a and b are equal? Why do a [I]==a [j]
find wrong!

CodePudding user response:

refer to the second floor QZJHJXJ response:
for reference:
 bool same (int a [], int [] b, int n)//equal length, are equal in each position of the element 
{
int i;
for(i=0; iIf (a [I]! [I]=b) return false;
}
return true;
}
ok thank you
  • Related