-
输入一个字符串,长度小于等于200,然后将输出按字符顺序升序排序后的字符串。
做这道题的时候不需要考虑太多,不用考虑空格
题目描述:
-
输入:
-
测试数据有多组,输入字符串。
-
输出:
-
对于每组输入,输出处理后的结果。
-
样例输入:
-
bacd
-
样例输出:
-
abcd
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
using namespace std;
int main()
{
char s[200];
while (scanf("%s",s)!=EOF)
{
int i=strlen(s);
sort(s,s+i);
cout<<s<<"\n";
}
return 0;
}