用指针来做------
#include <stdio.h>
main(){
int a,b,*p1,*p2,*p;
scanf(“%d,%d”,&a,&b);
p1=&a;p2=&b;
if(a<b){ p=p1; p1=p2; p2=p;}
}
printf(“%d,%d,”*p1,*p2);}
第二种直接来
#include <stdio.h>
int main(){
int a,b,t;
scanf(%d,%d,&a,&b);
if(a<b){
t=a; a=b; b=t;
printf(“%d,%d”,a,b);
}
用条件运算符做
#include <stdio.h>
int main(){
int i,j,a,b;
scanf("%d %d", &a,&b);
a>b?printf("%d %d",a, b):printf("%d %d",b, a);
}