...然后将输入的整数按照从小到大的顺序放在变量a、b、c中,并输_百度...
发布网友
发布时间:2024-09-30 05:48
我来回答
共1个回答
热心网友
时间:2024-10-09 22:11
#include <stdio.h>
void main()
{
int a, b, c, d;
printf("请输入a,b,c的值:\n");
scanf("%d%d%d",&a,&b,&c);
if(a>=b)
{
d = a;
a = b;
b = d;
}
else if(b>=c)
{
d = b;
b = c;
c = d;
}
printf("排序后:\n");
printf("%d %d %d",a,b,c);
}
热心网友
时间:2024-10-09 22:16
#include <stdio.h>
void main()
{
int a, b, c, d;
printf("请输入a,b,c的值:\n");
scanf("%d%d%d",&a,&b,&c);
if(a>=b)
{
d = a;
a = b;
b = d;
}
else if(b>=c)
{
d = b;
b = c;
c = d;
}
printf("排序后:\n");
printf("%d %d %d",a,b,c);
}