文章

65

粉丝

25

获赞

662

访问

20.1k

头像
ASCII码排序 题解:神人题
P5291 浙江工商大学2022年机试题
发布于2025年3月26日 17:19
阅读数 98

#include<bits/stdc++.h>
using namespace std;
bool cmp(char a,char b){
    return a<b;
}
int main(){
    string str;
    while(cin>>str) {
        sort(str.begin(),str.end(),cmp);
        for(int i=0;i<str.size();i++){
            cout<<str[i]<<' ' ;
        }
        cout<<endl;
    }
    return 0;
}

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发