#include <iostream>
#include <string>
using namespace std;
string st, out;
int a[10], k;
int main() {
cin >> st >> k;
for (int i = 0; i < st.size(); i++)
a[st[i] - '0']++;
while (k > 0) {
int ans = 0;
for (int i = 0; i < st.size(); i++)
if (st[i] > st[ans])
ans = i;
st[ans] = 0;
k--;
}
for (int i = 0; i < st.size(); i++) {
if (st[i] != 0)
cout << st[i];
}
}
我的代码问题应该是
因为我没有考虑0在前
比如
100000005
2
我的代码输出0000000
求您宝贵建议