C-study/06/2/2.c

27 lines
434 B
C
Raw Permalink Normal View History

2021-11-21 12:45:20 +00:00
#include<stdio.h>
int main(){
int a[10],temp;
printf("Please input score:\n");
for(int i=0;i<10;i++){
scanf("%d", &a[i]);
}
for(int i=0;i<10;i++){
for(int j=i;j<10;j++){
if(a[i]<a[j]){
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
for(int i=0;i<10;i++){
printf("%d\t", a[i]);
}
return 0;
}