#define _CRT_SECURE_NO_WARNINGS 1
#include"stdio.h"
#include"stdlib.h"
int main()
{
int a[10] = { 0 }, n,x,b,t;
for (n = 0; n <= 9; n++)
{
a[n] = rand() % 50 + 20;
printf("%5d", a[n]);
}
printf("\n");
for (x = 0; x <= 9; x++)
{
for (b = x + 1; b <= 9; b++)
{
if (a[x] < a[b])
{
t = a[x];
a[x] = a[b];
a[b]=t;
}
}
}
for (n = 0; n <= 9; n++)
{
printf("%5d", a[n]);
}
return 0;
}