程序代码:#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]){
int i,j,a[10],t;
for(i=0;i<10;i++){
a[i]=rand()%100;
}
for(i=0;i<9;i++){
for(j=0;j<10-1;j++){
if(a[j]<a[j+1]){
t=a[j+1];
a[j+1]=a[j];
a[j]=t;
}
}
}
for(i=0;i<10;i++){
printf("%d ",a[i]);
}
return 0;
}