编写程序,输入a,b,c三个整数,然后按由大到小顺序重新放入a,b,c中,并输出a,b,c的值?

如题所述

第1个回答  2020-03-03

#include<stdio.h>

#include<string.h>

int main()

{

int a,b,c,t;

scanf("%d%d%d",&a,&b,&c);

if(a<b)

{

t=a;

a=b;

b=t;

}

if(a<c)

{

t=a;

a=c;

c=t;

}

if(b<c)

{

t=b;

b=c;

c=t;

}

printf("%d %d %d",a,b,c);

return 0;

}

本回答被网友采纳
相似回答
大家正在搜