社区讨论
求条
P14357[CSP-J 2025] 拼数参与者 3已保存回复 4
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 4 条
- 当前快照
- 1 份
- 快照标识符
- @mhqm7rxa
- 此快照首次捕获于
- 2025/11/09 02:25 4 个月前
- 此快照最后确认于
- 2025/11/09 02:25 4 个月前
为什么0pts?
CPP#include<bits/stdc++.h>
using namespace std;
int main(){
//#ifndef OFFLINE_JUDGE
//freopen("number.in","r",stdin);
//freopen("number.out","w",stdout);
//#else
//freopen("/home/noi/J/number/number2.in","r",stdin);
//freopen("/home/noi/J/number/number2.out","w",stdout);
//#endif // OFFLINE_JUDGE
vector<int>v;
char c;
while(cin>>c){
if('0'<=c&&c<='9'){
//cout<<c;
v.push_back(c-'0');
}
}
cout<<endl;
sort(v.rbegin(),v.rend());
for(int i:v){
cout<<i;
}
return 0;
}
回复
共 4 条回复,欢迎继续交流。
正在加载回复...