提交时间:2024-03-02 08:58:37
运行 ID: 133710
#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; }