// 從大到小輸出三個整數
#include
int main() {
int a,b,c;
printf("請輸入三個整數(逗號隔開): ");
scanf("%d,%d,%d",&a,&b,&c);
if(a > b) {
if(b > c) printf("%d %d %d\n\n",a,b,c);
else if(a > c) printf("%d %d %d\n\n",a,c,b);
else printf("%d %d %d\n\n",c,a,b);
}
else if(c > b) printf("%d %d %d\n\n",c,b,a);
else if(a > c) printf("%d %d %d\n\n",b,a,c);
else printf("%d %d %d\n\n",b,c,a);
return 0;
}https://iknow-pic.cdn.bcebos.com/908fa0ec08fa513d45e0979f3d6d55fbb2fbd92d
// 從大到小輸出三個整數
#include
int main() {
int a,b,c;
printf("請輸入三個整數(逗號隔開): ");
scanf("%d,%d,%d",&a,&b,&c);
if(a > b) {
if(b > c) printf("%d %d %d\n\n",a,b,c);
else if(a > c) printf("%d %d %d\n\n",a,c,b);
else printf("%d %d %d\n\n",c,a,b);
}
else if(c > b) printf("%d %d %d\n\n",c,b,a);
else if(a > c) printf("%d %d %d\n\n",b,a,c);
else printf("%d %d %d\n\n",b,c,a);
return 0;
}https://iknow-pic.cdn.bcebos.com/908fa0ec08fa513d45e0979f3d6d55fbb2fbd92d