按升序打印X,Y,Z的整数值
#include <stdio.h>
#define TRUE 1
#define FALSE 0
int main()
{
int x,y,z;
printf("x: "); scanf("%d", &x);
printf("y: "); scanf ("%d", &y);
printf("z: "); scanf("%d", &z);
if ((x<y)&&(y<z)) {
printf("%d ", x);
if (y<z) printf ("%d %d\n", y,z);
else printf("%d%d\n", z, y);
}
else if ((y<x)&&(y<z)){
printf("%d ", y);
if (x<z) printf ("%d %d\n", x,z);
else printf("%d%d\n", z,x);
}
else
printf("%d %d %d\n", z, y, x);
return 0;
}
posted on 2017-12-30 10:41 MACHINE_001 阅读(101) 评论(0) 编辑 收藏 举报