题解(时间复杂度略高)
2026-10-08 20:51:19
发布于:上海
0阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
string s;
int main(){
cin>>s;
s=regex_replace(s,regex("\D"),"");// 用正则 \D(非数字)匹配所有非数字字符,替换为空串
sort(s.begin(),s.end(),greater<char>());//从大到小排序
cout<<s;
}
这里空空如也








有帮助,赞一个