提交时间:2023-11-04 11:09:30

运行 ID: 108825

#include<cstdio> #include<cmath> #include<algorithm> #include<cstring> #include<string> #include<iostream> using namespace std; int main() { char num[500]; int gs,bl; scanf("%s%d",num,&gs); int len=strlen(num); bl=len-gs; int shu[500]; for(int i=0;i<len;i++)shu[i]=num[i]-'0'; int bln[500],js=0,sgw=-1; int lim,minn; while(bl-js) { minn=2e9; for(int i=sgw+1;i<=len-bl+js;i++)if(shu[i]<minn)minn=shu[sgw=i]; bln[js++]=shu[sgw]; } int start=0; for(int i=start;i<bl;i++)printf("%d",bln[i]); return 0; }