Home > Back-end >  The output of the great god help me to look at this program have what problem?
The output of the great god help me to look at this program have what problem?

Time:10-18

# include
# define MAXIN 100
Int a [MAXIN];
Int main ()
{
Int x, n=0, I;

While (the scanf (" % d ", & amp; X)==1)

A [n++]=x;
For (I=n - 1; I>=1; I -)
Printf (" % d ", a [I]);
Printf (" % d \ n ", a [0]).

return 0;


}
12345 why input 12345 a, output and input 1 2 3 4 5 a output for 54321.

CodePudding user response:

Came to an end the scanf in space. The tabs to read, enter 1234 believe that only one character at a time, so the output of 1234.

CodePudding user response:

Problem as the upstairs said,
In addition, careful overflow,
  • Related