Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
437504 黄浙峰老师 【C6-7】删数问题 C++ 解答错误 10 1 MS 256 KB 373 2026-04-25 09:29:23

Tests(1/10):


#include<bits/stdc++.h> using namespace std; int main(){ char s[278]; 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; }


测评信息: