Home > Back-end >  Look at this program can help me? You can run but the result is wrong
Look at this program can help me? You can run but the result is wrong

Time:12-27

I want to run the n input number, put it in a of the array, the array of six integer still store in ascending order
/* Note: Your choice is the IDE */C
#include
# define N 6
Int main ()
{int I, j, t;
Int a [5]=,3,5,7,9 {1};
Printf (" input an arbitrary integer n: ");
The scanf (" % d ", & amp; A [j]);
for(i=0; i<6; I++)
for(j=0; J=I + 1; J++)
If (a [I] & gt; A [j])
{t=a[i]; A [I]=a, [j]. A [j]=t; }
Printf (" after the sorting: \ n ");
for(j=0; J<6; J++)
Printf (" % d ", a [j]);
return 0;


}
  • Related