#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
int a = 0;
int b = 0;
int c = 0;
scanf("%d,%d%,d", &a, &b, &c);
if (a<b)//不创建零时变量tmp,直接赋值会把abc原来的值丢失
{//我们要做ab的交换
int tmp = a;//a先放进tmp中,a就空了
a = b;//把大的值放到a里
b = tmp;//均上是醋瓶调换原理
}
if (a < c)
{
int tmp = a;
a = c;
c = tmp;
}
if (b < c)
{
int tmp = b;
b = c;
c = tmp;
}
printf("%d %d %d\n", a, b, c);
}
==================
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
int a = 0, b = 0, c = 0,tmp=0;
scanf("%d %d %d", &a, &b, &c);
if (b > a)
{
tmp = b; b = a; a = tmp;
}
if (c > a)
{
tmp = c; c = a; a = tmp;
}
if (c > b)
{
tmp = c; c = b; b = tmp;
}
printf("%d %d %d", a, b, c);
}