Home > Back-end >  Don't know why can't output, with bosses didn't quit the loop, not input line will ex
Don't know why can't output, with bosses didn't quit the loop, not input line will ex

Time:04-24

CodePudding user response:

 # include & lt; Stdio. H> 

# define MAX_ARR_SIZE (50)
Int main (void)
{
An int array [MAX_ARR_SIZE], * p;

int i=0;

While (I & lt; MAX_ARR_SIZE & amp; & The scanf (" % d ", & amp; Array [i++])==1)
;

P=array + I - 2;

for (; P & gt;=array; P -)
Printf (" % d \ n ", * p).

return 0;
}

For your reference

 # include & lt; Stdio. H> 

# define MAX_ARR_SIZE (50)
Int main (void)
{
An int array [MAX_ARR_SIZE], * p;

int i=0;

P=array;
While (p & lt; Array + MAX_ARR_SIZE & amp; & The scanf (" % d ", p++)==1)
;

//p=array + I - 2;

For (p=p - 2; P & gt;=array; P -)
Printf (" % d \ n ", * p).

return 0;
}

For your reference ~

Not the cause of the output is still not back from the while loop, that is, while is when=='\ n' exit;
  • Related