文章

24

粉丝

27

获赞

120

访问

6.3k

头像
数字排序 题解:c++最简洁解法
P1966 华东师范大学2023年机试
发布于2025年3月14日 14:24
阅读数 338

#include <bits/stdc++.h>
using namespace std;
int main() {
      int n;
      cin>>n;
    vector<string> s(n);
    for(auto &i:s)
      cin>>i;
    sort(s.begin(),s.end(),[](string a,string b){
        return stold(a)<stold(b);
    });
    for (auto &num:s) {
        cout<<num<<endl;
    }
    return 0;
}

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发