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