题目链接:http://codeup.cn/problem.php?cid=100000581&pid=3
题目描述
输入一个字符串,长度小于等于200,然后将输出按字符顺序升序排序后的字符串。
输入
测试数据有多组,输入字符串。
输出
对于每组输入,输出处理后的结果。
样例输入
tianqin
样例输出
aiinnqt
代码
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main() {
char str[200];
while(gets(str)){
int len = strlen(str);
sort(str, str + len);
puts(str);
}
return 0;
}