方法一
#include<stdio.h>int min(int a,int b){return a>b?b:a;}int max(int a,int b){return a>b?a:b;}void main(){int x,y,z;scanf("%d,%d,%d",&x,&y,&z);printf("small to big is %d %d %d\n", min(min(x,y),z), (x>min(min(x,y),z) && x<max(max(x,y),z)) ? x : y>min(min(x,y),z) && y<max(max(x,y),z) ? y : z, max(max(x,y),z));}
方法二
#include<stdio.h>void main(){int x,y,z,t;scanf("%d,%d,%d",&x,&y,&z);if(x>y){t=x;x=y;y=t;}if(x>z){t=x;x=z;z=t;}if(y>z){t=y;y=z;z=t;}printf("small to big is %d %d %d\n",x,y,z);}