#include<stdio.h>
int main()
{
int tmp;
int data1,data2,data3;
printf("请输入三个整数:\n");
scanf("%d%d%d",&data1,&data2,&data3);
if(data1>data2){
tmp = data1;
data1 = data2;
data2 = tmp;
}if(data2>data3){
tmp = data2;
data2 = data3;
data3 = tmp;
}if(data1>data2){
tmp = data1;
data1 = data2;
data2 = tmp;
}
printf("%d %d %d\n",data1,data2,data3);
return 0;
}
三个整数从小到大输出(代数法)
最新推荐文章于 2022-03-02 18:36:08 发布