Home > Back-end >  A beginner
A beginner

Time:06-09

Why the last one is not the same as

CodePudding user response:

Code!!!!!!!!!!

CodePudding user response:

reference 1st floor datoulaile123 response:
code!!!!!!!!!!

#include
#include

/* run this program using the console pauser or add your own getch, system (" pause ") or the input loop */

Int main (int arg c, char * argv []) {
Int n, I, j, a [100] [100], the sum [100]={0}, s=0;
While (the scanf (" % d ", & amp; n)!=(EOF)
{
for(i=0; I{
for(j=0; J{
The scanf (" % d ", & amp; A [I] [j]);
}
}
for(i=0; I{
for(j=0; J{
The sum [I] +=a, [I] [j].
}
}
S=sum [0].
for(i=0; I{
If (s!=sum [I])
S=sum [I];
}
If (s==sum [0])
{
Printf (" Yes % d \ n ", s);
}
The else
{
Printf (" \ n ");
}
}
return 0;
}

CodePudding user response:

Empty the sum and s while the next cycle

CodePudding user response:

And magic matrix judgment is wrong, why didn't calculate diagonal lines and vertical lines

CodePudding user response:

reference datoulaile123 reply: 3/f
while the next cycle to give a sum and s empty

Well, don't know clear which...

CodePudding user response:

reference 4 floor datoulaile123 response:
and magic matrix judgment is wrong, why didn't calculate diagonal and vertical bar

How to calculate, diagonal,

CodePudding user response:

refer to 6th floor qq_45880623 response:
Quote: refer to 4th floor datoulaile123 response:
and magic matrix judgment is wrong, why didn't calculate diagonal and vertical bar

How to calculate, diagonal,

You in the loop I==j and I==(n - j) should be two diagonals, no test, after all is symmetrical, adjust the can see the code

CodePudding user response:

reference 5 floor qq_45880623 reply:
Quote: refer to the third floor datoulaile123 response:
while the next cycle to give a sum and s empty

Well, don't know clear which...

 while (the scanf (" % d ", & amp; N)!=(EOF) 
{
Memset (sum, 0, 100);
S=0;
For (I=0; I & lt; n; I++)
{
For (j=0; J & lt; n; J++)
{
The scanf (" % d ", & amp; A [I] [j]);
}
}
.

CodePudding user response:


I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related