Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
150940 lrf820215 删数问题 C++ 通过 100 0 MS 252 KB 370 2024-06-10 09:50:56

Tests(9/9):


#include<string> #include<iostream> using namespace std; int main(){ string x; int S,i; //freopen("input.txt","r",stdin); while(cin>>x>>S){ while(S--){ int len=x.length(); for(i=0;i<len-1;) if(x[i]>x[i+1]){ x.erase(x.begin()+i); break; } else i++; if(i==len-1) x.erase(x.begin()+i); } cout<<x<<endl; } }


测评信息: