输入3个数a,b,c,按大小顺序输出。

如题所述

#include
void main()
{
int a,b,c;
printf("请输入三个整数,以空格分隔:");
scanf("%d%d%d",&a,&b,&c);
int temp;
if(a>b)
{
temp = a;
a = b;
b = temp;
}
if (b > c)
{
temp = b;
b = c;
c = temp;
}
printf("结果为:%d,%d,%d\n",c,b,a);
}
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答