提交时间:2021-06-19 20:05:24

运行 ID: 20703

#include<bits/stdc++.h> using namespace std; int main(){ string s; int w=0,p=0; cin>>s>>p; int minn=s[1]; for(int i=2;i<=s.size();i++){ minn=min(minn,s[i]-48); if(minn==s[i]) w=i; } s[w]=(char)p+48; cout<<s; return 0; }