Vinh ngu doc di

thanhvinh 2023-01-03 9:27:29 2023-01-04 13:10:53

#include<bits/stdc++.h>

using namespace std;
string s;
int k,x,vt=0,vt1,a;

int main(){
cin >> s;
cin >> k;
k=s.size()-k;
for(int j=k-1;j>=0;j--){
        x=10;
for (int i=vt;i<s.size()-j;i++)
{
    a=int(s[i]-'0');
    if (a<x){x=a;vt1=i;}

}
vt=vt1+1;;
cout << x;

}
}