输入其他数可以完成排序#include<stdio.h>int main(){int a,b,c,d,e;scanf("%d,%d,%d,%d",&a,&b,&c,&d);if(a<b){e=b;b=a;a=e;}if(a<c){e=c;c=a;a=e;}if(a<d){e=d;d=a;a=e;}if(b<c){e=c;c=b;b=c;}if(b<d){e=d;d=b;b=e;}if(c<d){e=d;d=c;c=e;}printf("%d,%d,%d,%d",a,b,c,d); return 0;}
- 3 回答
- 0 关注
- 1533 浏览
添加回答
举报
0/150
提交
取消