https://vjudge.net/problem/hdu-2000
输入三个字符,根据ASCII的顺序从小到大排列
因为用上数组会很麻烦,然后题目也比较简单,就直接设置一个变量做交换中转站好了
#include <iostream>
using namespace std;
int main()
{
char a, b, c,temp;
while (cin>>a>>b>>c)
{
if (a > b)
temp = a, a = b, b = temp;
if (a > c)
temp = a, a = c, c = temp;
if (b > c)
temp = b, b = c, c = temp;
cout << a << ' ' << b << ' ' << c << '\n';
}
}