题目1054:字符串内排序
时间限制:1 秒
内存限制:32 兆
特殊判题:否
提交:5981
解决:3337
-
题目描述:
-
输入一个字符串,长度小于等于200,然后将输出按字符顺序升序排序后的字符串。
-
输入:
-
测试数据有多组,输入字符串。
-
输出:
-
对于每组输入,输出处理后的结果。
-
样例输入:
-
bacd
-
样例输出:
-
abcd
-
答疑:
- 解题遇到问题?分享解题心得?讨论本题请访问: http://t.jobdu.com/thread-7778-1-1.html
-
-
#include <stdio.h> #include <algorithm> #include <string.h> using namespace std; char s[201]; int main() { int l; while(gets(s)) { l=strlen(s); sort(s,s+l); printf("%s\n",s ); } return 0; }