#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int main(){
//从小到大排列数字
int a = 0;
int b = 0;
int c = 0;
int t;
int *d, *e, *f;
printf("请输入三个数:");
scanf("%d%d%d", &a, &b, &c);
d = &a;
e = &b;
f = &c;
if (a > b){
t = *d;
*d = *e;
*e = t;
}
if (a > c){
t = *d;
*d = *f;
*f = t;
}
if (b > c){
t = *e;
*e = *f;
*f = t;
}
printf("%d <= %d <= %d\n", *d, *e, *f);
printf("%d <= %d <= %d\n", a, b, c);
system("pause");
return 0;
}
原文:https://www.cnblogs.com/Leafbud/p/12633946.html