#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<memory.h>
#include<cstdio>
#include<list>
#include<string>
#include<map>
#include<cmath>
#include <algorithm>
#include <queue>
#define NUM 1000
#define maxint 10000000
#define INF 0x3f3f3f3f
using namespace std;
int c[NUM][NUM];//用邻接矩阵存储边和权
int dist[NUM];
string a;
int k;
int main()
{
freopen("in.txt", "r", stdin);
while(cin>>a>>k)
{
if(a.size()<=k)
{
a.erase();
}
else
{
while(k>0)
{
int i;
for( i = 0;i<a.size()-1 && a[i]<a[i+1];i++);
a.erase(i,1);
k--;
}
}
int i = 0;
while(a[i]=='0')
{
i++;
}
cout<<a.substr(i)<<endl;
}
}
输入:
178543
4
87654321
2
123456789
1
254193
1
90249
2
0
输出:
13
654321
12345678
24193
24