```c
#include<stdio.h>
int main()
{
int a[5],i,j,t;
for(i=1;i<=5;i++)
{
scanf("%d",&a[i]);
}
for(i=1;i<=5;i++)
{
for(j=i;j<=5;j++)
{
if(a[j]>a[i])
{
t=a[i];
a[i]=a[j];
a[j]=t;
}
}
}
for(i=1;i<=5;i++)
{
printf("%d ",a[i]);
}
return 0;
}
运行结果:
![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/079377562696129.png "#left")