提交时间:2023-11-04 11:15:03
运行 ID: 108848
# include <bits/stdc++.h> using namespace std ; int main ( ) { string x ; int y , len , j ; cin >> x >> y ; len = x . size ( ) ; for ( int i = 1 ; i <= y ; i ++ ) { for ( j = 0 ; j < len - 1 ; j ++ ) { if ( x [j] > x [j + 1] ) { for ( int k = j ; k < len - 1 ; k ++ ) { x [k] = x [k + 1] ; } break ; } } len -- ; } j = 0 ; int m = len ; while ( x [j] == 0 && m > 1 ) { j ++ ; m -- ; } for ( int i = j ; i < len ; i ++ ) { cout << x [i] ; } return 0 ; }