输入其他数可以完成排序
#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;
}
二部学习小组
慕娘6529770
TigerSleepy
相关分类