知识点 | 字符串 |
---|---|
运行时间限制 | 0M |
内存限制 | 0 |
输入 | Lily使用的图片包括"A"到"Z"、"a"到"z"、"0"到"9"。输入字母或数字个数不超过1024。
|
输出 | Lily的所有图片按照从小到大的顺序输出
|
样例输入 | Ihave1nose2hands10fingers |
样例输出 | 0112Iaadeeefghhinnnorsssv |
#include <iostream>
#include <algorithm>#include <string>
using namespace std;
int main()
{
string n;
cin >> n;
sort(n.begin(), n.end());
cout << n;
}
或者直接比较ascll值0=47,A=65,A=97,if(S[0]>S[1])