其他分享
首页 > 其他分享> > 将三个数按从大到小输出

将三个数按从大到小输出

作者:互联网

#include<stdio.h>
#include<stdlib.h>
int main() {
int x, y, z;
int max;
printf(“请输入三个整数:”);
scanf_s("%d %d %d",&x,&y,&z);
if (x <= y) {
max = y;
y=x;
x = max;
}
if (x <= z) {
max = z;
z = x;
x = max;
}if (y <= z) {
max = z;
z = y;
y = max;
}
printf("%d %d %d", x,y,z);
system(“pause”);
return 0;
}

标签:输出,main,大到,int,max,pause,三个,printf,include
来源: https://blog.csdn.net/qq_42611852/article/details/100010086