1
0

1005.cpp 421 B

12345678910111213141516171819202122
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <algorithm>
  4. using namespace std;
  5. int main() {
  6. char num[11];
  7. int del;
  8. scanf("%s %d", num, &del);
  9. for (char* i = num; *i != 0; ) {
  10. if (*i > *(i+1) && del != 0) {
  11. for (char* j = i; *j != 0; ++j) {
  12. *j = *(j+1);
  13. }
  14. i = num;
  15. --del;
  16. } else ++i;
  17. }
  18. cout << num;
  19. return 0;
  20. }