Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
133710 | mairuisheng | 删数问题 | C++ | 通过 | 100 | 0 MS | 252 KB | 496 | 2024-03-02 08:58:37 |
#include<bits/stdc++.h> using namespace std; int main() { int s; string n,n1; cin>>n>>s; int ln=n.length(); string::iterator it=n.begin(); while(s) { int i=0; while(i<ln&&n[i]<=n[i+1]) { i++; } s--; n.erase(it+i); } int k=0; bool pd=false; for(int i=0;i<n.length();i++) { cout<<n[i]; k++; } if(k==0) cout<<"0"; return 0; }