提交时间:2019-11-02 19:27:19
运行 ID: 1937
#include<bits/stdc++.h> #include<string> using namespace std; int main(){ int s,i,j,len,k; string n; cin>>n>>s; len=n.length(); for (i=1;i<=s;++i) { for ( j=0;j<len-1;++j ) if ( n[j]>n[j+1] ) { for (k=j;k<len-1;++k){ n[k]=n[k+1]; n[k+1]='\0'; } break; --len; } } cout<<n; }