The code is as follows:
# include "stdafx. H"
# include "iostream"
# include "time. H"
# include "cstdlib
"
Const int num=100;
using namespace std;
A void show_ar (int *);
Int main ()
{
Int ar (num);
Srand (time (0));
for (int i=0; i
Show_ar (ar);
//rearrangement arrary.
cout <"After rearrangement: \ n";
for (int i=0; i
Int temp=ar [I];
int index=0;
For (int j=I + 1; j
If (temp & gt;=ar [j])
{
Temp=ar [j];
The index=j;
}
}
Ar=ar [index] [I];
Ar [I]=temp;
}
Show_ar (ar);
return 0;
}
A void show_ar (int *)
{
for (int i=0; i
If (a [I] <10)
cout <"";
cout If ((I + 1) % 10==0)
cout
}
The results are as follows: