//三个数从大到小输出2022.2.22
#include<stdio.h>
#include<string.h>
int main(){
//得到让用户输入的三个数
int a,b,c;
int tem;
printf("请输入三个数\n");
scanf("%d%d%d",&a,&b,&c);
//将数从大到小排序
if(a<=b){
tem = a;
a = b;
b = tem;
}
if(a<=c){
tem = a;
a = c;
c = tem;
}
if(b<=c){
tem = b;
b = c;
c = tem;
}
//将数依次输出
printf("从大到小输出为>%d %d %d\n",a,b,c);
return 0;
}
三个数从大到小输出的c-code
于 2022-01-22 16:02:18 首次发布