Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
332709 | 黄浙峰老师 | 【C6-7】删数问题 | C++ | 解答错误 | 10 | 3 MS | 264 KB | 379 | 2025-07-15 10:33:11 |
#include<bits/stdc++.h> using namespace std; int main(){ char s[245]; int n,l,t; cin>>s>>n; l=strlen(s); sort(s,s+l); t=l-n; if(s[t-1]=='0'){ if(t==1){ cout<<0; return 0; }else{ for(int i=t; i<l; i++){ if(s[i]!='0'){ swap(s[i],s[0]); break; } } } } for(int i=0; i<t; i++){ cout<<s[i]; } return 0; }