ASCII码排序

题目http://acm.nyist.net/JudgeOnline/problem.php?pid=4

#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
    char a[10];
    int t;
    scanf("%d",&t);
    getchar();//可吸收换行,避免换行被gets()当做字符输入
    while(t--)
    {
        gets(a);
        sort(a,a+3);//可以对字符串排序
        for(int i=0;i<3;i++)
        {
            printf("%c ",a[i]);
        }
        printf(" ");
    }
    return 0;
}

"No regrets."
原文地址:https://www.cnblogs.com/zxy160/p/7215195.html