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