提交时间:2019-10-28 22:00:21

运行 ID: 1898

#include<bits/stdc++.h> using namespace std; string n; int s,len,k; int main(){ cin>>n>>s; len=n.length(); while(s>0){ s--; k=len-1; for(int i=0;i<len-1;i++) if(n[i]>n[i+1]){ k=1; break; } n.erase(k,1); len--; } while(n[0]=='0') n.erase(0.1); if(n!="") cout<<n<<endl; else cout<<"0"<<endl; return 0; }