题解 1749: 字符排序

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

1749: 字符排序

摘要:#include<bits/stdc++.h> using namespace std; int main(){     int n;     cin >> n;     getchar……

C++字符排序(通过字符串输入)

解题思路:注意到题目中字符串长度比较小,通过选择冒泡等方法应该也能实现,但是本人很懒,因此还是用标准库中的sort函数实现。由于字符数组存储过于麻烦,因此选择通过string类型来读入,再逐个赋值,复杂度较低,熟练掌握STLsort函数即可参考代码:#include#include

1749: 字符排序(C++题解)

##上代码!里面详细教程```cpp/*思路:1.定义整数n和字符串s2.输入n3.for循环输入s4.快排sort(格式):sort(s.begin(),s.end());5.输出s*/#includeusingnamespacestd;intmain(){intn;strings;cin>>n;f