27 lines
444 B
C
27 lines
444 B
C
|
#include<stdio.h>
|
||
|
|
||
|
int main(){
|
||
|
int n,a[10],temp;
|
||
|
|
||
|
scanf("%d", &n);
|
||
|
|
||
|
for(int i=0; i<n; i++){
|
||
|
scanf("%d", &a[i]);
|
||
|
}
|
||
|
|
||
|
for(int i=0;i<n-1;i++){
|
||
|
for(int j=0;j<n-i-1;j++){
|
||
|
if(a[j]<a[j+1]){
|
||
|
temp=a[j];
|
||
|
a[j]=a[j+1];
|
||
|
a[j+1]=temp;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
for(int i=0;i<n;i++){
|
||
|
printf("%d",a[i]);
|
||
|
if(i != n - 1){printf(" ");}
|
||
|
}
|
||
|
}
|