文章

28

粉丝

0

获赞

99

访问

3.7k

头像
字符串排序 题解:
P1254 北京大学机试题
发布于2025年3月17日 16:35
阅读数 95

#include<bits/stdc++.h>
using namespace std;
bool cmp_up(char a,char b)
{
return a<b;
}
int main(){
	string s;
	getline(cin,s);        
	stable_sort(s.begin(),s.end(),cmp_up);     //数组可用长度加,而节点,字符串可以使用begin(),end();
	for(auto a:s) cout<<a;
return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发