C++ 代码
#include<iostream>
using namespace std;
int main(){
string a, b;
while(cin >> a >> b){
string d;
int max = -1, cnt = 0;
for(int i = 0; i < a.length(); i++){
if(max < a[i]) max = a[i], cnt = i;
}
cout << a.substr(0, cnt + 1) + b + a.substr(cnt+ 1);
cout << endl;
}
return 0;
}