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