题解 | 排序危机

排序危机

https://www.nowcoder.com/practice/fb6a53f3ebae449cb268fd9a99cff9ef

#include<iostream>
using namespace std;
int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    string lower,digit,upper;
    for(char c:s){
        if(c>='a'&&c<='z')lower+=c;
        else if(c>='0'&&c<='9')digit+=c;
        else if(c>='A'&&c<='Z')upper+=c;
    }
    cout << lower+digit+upper << endl;
    return 0;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务