Home > Back-end >  The number of c language reorganization
The number of c language reorganization

Time:10-06

Consult: enter a 4 digit, how will the digital digital reorganization, to generate the restructuring of the largest number

CodePudding user response:

You have four Numbers from left to right, from big to small order

CodePudding user response:

For example
 int main () {
Int a [4]={1, 1, 1, 1};
Int n, t, I, j;
4 the scanf (" % d ", & amp; N);
While (n) {
T=n % 10;
For (I=3; I>=0& & A [I] For (j=2; J> i; J -) a [j + 1)=a, [j].
A [+ + j]=t;
N/a=10;
}
for (i=0; i<4. I++) printf (" % d ", a [I]);
return 0;
}
  • Related