首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
fuuuuuu
2026年3月12日 20:52
字符串排序 题解:
P1254
回复 0
|
赞 2
|
浏览 34
一个sort解决 #include<bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ //vector<int> a;//先别预设长度,防止有多的0掺和进来 sort(s.begin(),s.end());//s直接能排序 &n...
uly
2026年3月4日 16:22
字符串排序 题解:
P1254
回复 0
|
赞 4
|
浏览 105
#include <bits/stdc++.h> using namespace std; int main() { string s; while (getline(cin,s)) { vector<int> val; for (int i=0; i<s.length(); i++) { val.push_back(s[i]-'a'); } sort(val.begin(), val.end()); ...
Ranz
2026年2月7日 04:08
字符串排序 题解:
P1254
回复 0
|
赞 7
|
浏览 186
#include<bits/stdc++.h> using namespace std; int main(){ string str; while(cin >> str){ sort(str.begin(),str.end()); cout << str << endl; ...
xsw
2026年2月3日 17:13
字符串排序 题解:
P1254
回复 0
|
赞 1
|
浏览 147
#include<iostream> #include<algorithm> using namespace std; int main() { string s; cin >> s; sort(s.begin(), s.end()); cout << s << endl; return 0; }
mlx
2026年1月31日 17:01
字符串排序 题解:
P1254
回复 0
|
赞 0
|
浏览 70
#include<iostream> #include<algorithm> using namespace std; string str; int main() { while(cin>>str) { sort(str.begin(),str.end()); cout<<str<<endl; } return 0; }
yauqq
2026年1月29日 10:05
字符串排序 题解:
P1254
回复 0
|
赞 0
|
浏览 120
#include<bits/stdc++.h> using namespace std; int main(){ string str; while(cin >> str){ sort(str.begin(), str.end()); cout<< str <<endl; } return 0; }
曾不会
2026年1月25日 11:55
字符串排序 题解:
P1254
回复 0
|
赞 1
|
浏览 78
#include<stdio.h> #include<algorithm> #include<string.h> using namespace std; int main() { char s[100]; scanf("%s",s); int l=strlen(s); sort(s,s+l); printf("%s...
曾不会
2026年1月25日 11:50
字符串排序 题解:
P1254
回复 0
|
赞 1
|
浏览 223
数组+冒泡排序 #include<stdio.h> #include<string.h> int main() { char s[100]; scanf("%s",s); int l=strlen(s); if(s[l-1]=='\n') { ...
曾不会
2026年1月25日 11:45
字符串排序 题解:
P1254
回复 0
|
赞 0
|
浏览 190
python n=input() t=dict() l=len(n) for i in n: if i in t: t[i]+=1 else: t[i]=1 tt=sorted(t) for i in tt: while(t[i]): print(i,end="") t[i]-=1
无名1
2025年9月2日 18:46
字符串排序 题解:C++
P1254
回复 0
|
赞 4
|
浏览 1.2k
#include<bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ for(int i=0;i<s.length()-1;i++){ for(int j=i;j<s.length();j++){ if(int(s[i])>int(s[j])){ swap(s[i],s[j]); } } } cout<<s<<endl; } return...
1
2
3
4
题目
字符串排序
题解数量
36
发布题解
在线答疑
热门题解
1
字符串排序 题解:sort(s.begin(),s.end())
2
字符串排序 题解:
3
字符串排序 题解:sort秒杀
4
字符串排序 题解:
5
字符串排序 题解:
6
字符串排序 (C++)题解:
7
字符串排序 题解:
8
字符串排序 题解:C++
9
字符串排序 题解:sort实现
10
字符串排序 题解:c 送分