提交时间:2024-03-02 08:42:08
运行 ID: 133623
#include <bits/stdc++.h> using namespace std; int main() { string s1, tmpp; int n; cin >> s1 >> n; for (int i = 1; i <= n; i++) { tmpp = s1; s1.erase(0, 1); for (int j = 1; j < tmpp.size(); j++) { string tmp = tmpp; tmp.erase(j, 1); if (s1 > tmp) s1 = tmp; } } cout << s1 << endl; return 0; }