Home > Back-end >  Great god help me to look at the trouble running result is what is wrong
Great god help me to look at the trouble running result is what is wrong

Time:12-04

? (T? T)? I stuck two hours the meowed

The first figure is the title, the second figure is my run results

#include
Int main ()
{
Int a [3], [3], I, t, j;
Printf (" do put in: \ n ");
for(i=0; i<3; I++)
{
for(j=0; j<3; J++)
{
The scanf (" % d ", & amp; A [I] [j]);
If (a [I] [j] % 3!=0)
Printf (" % 5 d, "a [I] [j]);
The else
Printf (" % 5 d \ n ", a [I] [j]);

}

}


T +=a, [I] [j].
Printf (" The result is=% d \ n ", t);
}

CodePudding user response:

T uninitialized began to t=0

CodePudding user response:

I didn't learn c + +!!!!! But I see ~ ~ t +=a, [I] [j]. This should be a cumulative process!!! The additive process outside loop???? Don't know how to calculate your t is the result?

CodePudding user response:

T didn't initialize, define variables when assigning a 0, and the t +=a [I] [j] why didn't in the for loop?

CodePudding user response:

#include
Int main ()
{
Int a [3], [3], I, j;
Int t=0;
Printf (" do input: \ n ");
for(i=0; i<3; I++)
{
for(j=0; j<3; J++)

{
The scanf (" % d ", & amp; A [I] [j]);
If (j==2)
Printf (" % 5 d \ n ", a [I] [j]);
The else
Printf (" % 5 d, "a [I] [j]);
T +=a, [I] [j].
}

}


Printf (" The result is: % d \ n ", t);
}


CodePudding user response:

refer to the second floor limeilu110 response:
I didn't learn c + +!! But I see ~ ~ t +=a, [I] [j]. This should be a cumulative process!!! The additive process outside loop???? Don't know how to calculate your t is the result?

Maybe because I didn't give t assignment it literally find number?

CodePudding user response:

Reference:
 # include 
Int main (int arg c, char * argv [])
{
Int a [3], [3], I, t=0, j.
Printf (" do put in: \ n ");
for(i=0; i<3; I++)
for(j=0; j<3; J++)
The scanf (" % d ", & amp; A [I] [j]);

for(i=0; i<3; I++)
for(j=0; j<3; J++)
{
Printf (" % 5 d, "a [I] [j]);
If ((j + 1) % 3==0)
printf("\n");
}

for(i=0; i<3; I++)
for(j=0; j<3; J++)
{
T +=a, [I] [j].
}
Printf (" The result is=% d \ n ", t);

return 0;
}

CodePudding user response:

Simplify the step:
 # include 
Int main (int arg c, char * argv [])
{
Int a [3], [3], I, t=0, j.
Printf (" do put in: \ n ");
for(i=0; i<3; I++)
for(j=0; j<3; J++)
{
The scanf (" % d ", & amp; A [I] [j]);
}

for(i=0; i<3; I++)
for(j=0; j<3; J++)
{
T +=a, [I] [j].
Printf (" % 5 d, "a [I] [j]);
If ((j + 1) % 3==0)
printf("\n");
}
Printf (" The result is=% d \ n ", t);

return 0;
}

To simplify the two step, input methods:
 # include 
Int main (int arg c, char * argv [])
{
Int a [3], [3], I, t=0, j.
Printf (" do put in: \ n ");
for(i=0; i<3; I++)
for(j=0; j<3; J++)
{
The scanf (" % d ", & amp; A [I] [j]);
Printf (" % 5 d, "a [I] [j]);
If ((j + 1) % 3==0)
printf("\n");
T +=a, [I] [j].
}
Printf (" The result is=% d \ n ", t);

return 0;
}

CodePudding user response:

This is running out for you, but I didn't understand in the beginning the pointer? An array is doing

CodePudding user response:

The
reference
int main (int arg c, char * argv [])
do you speak is it? This is just a compiler is different, the format of the generated different, you can put the deleted in brackets
 int main () 

CodePudding user response:

references 9 f QZJHJXJ response:
reference
int main (int arg c, char * argv [])
do you speak is it? This is just a compiler is different, the format of the generated different, you can put the deleted in brackets
 int main () 

Thank you, I understand.
  • Related