# include<stdio.h> int main(){ int A[10]; for(int i=0;i<10;i++ ){ scanf("%d",&A[i]); } for(int i=1;i<=9;i++){ for(int j=9;j>=i;j--){ if(A[j]<A[j-1]){ int temp=A[j]; A[j]=A[j-1]; A[j-1]=temp; } } } for(int i=0;i<10;i++){ printf("%d\n",A[i]); } return 0; } |
Double click to view unformatted code.