#include <stdio.h>
#include <string.h>
void main()
{
char *p1, *p2, *p3;
char a[100], b[100], c[100];
char temp;
gets(a);
gets(b);
gets©;
p1 = &a; p2 = &b; p3 = &c;
if (a > b)
{
temp = *p1;
*p1 = *p2;
*p2 = temp;
}
if (a > c)
{
temp = *p1;
*p1 = *p3;
*p3 = temp;
}
if (b > c)
{
temp = *p2;
*p2 = *p3;
*p3 = temp;
}
printf("%s,%s,%s ", *p1, *p2, *p3);
}
输入3个整数,按从小到大的顺序输出
最新推荐文章于 2024-05-21 22:13:58 发布