1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include<stdio.h> int main() { int hight[10]; int a,b,t; for(a=0;a<10;a++)//input 10 hill hight scanf("%d",&hight[a]); for(a=1;a<10;a++) { for(b=9;b>=a;b--) { if(hight[b-1]<hight[b])//putting big hight first { t=hight[b-1]; hight[b-1]=hight[b]; hight[b]=t; } } } for(t=0;t<3;t++) printf("%d\n",hight[t]);//print top three hill return 0; } |
If you only do what you can do you will never become more than you are now ___Master Shifu
Comments
Post a Comment