字符串排序 题解:
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.h>
using namespace std;
int main() {
char c[20];
while (cin >> c) {
int length = strlen(c);
sort(c, c + length);
for (int i = 0;i < length;i++) {
cout << c[i];
}
}
cout << endl;
}
登录后发布评论
暂无评论,来抢沙发