#include <stdio.h>
int main() {
float a, b, c, t; //定义a,b,c,t
scanf("%f %f %f", &a, &b, &c); //输入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("%0.2f<%0.2f<%0.2f", a, b, c); //保留两位小数
return 0; //返回值 0
}
【c语言】输入3个数,从小到大依次排序
最新推荐文章于 2023-07-24 18:28:09 发布