Run ID:158947

提交时间:2026-08-23 14:29:44

#include<bits/stdc++.h> using namespace std; int main() { string s,t; cin>>s>>t; int h=0,n=0; for(int i=0;i<s.length();i++){ if(s[i]<='9'&&s[i]>='0'){ h++; } } for(int i=0;i<t.length();i++){ if(t[i]<='9'&&t[i]>='0'){ n++; } } if(h<n){ for(int i=t.length()-1;i>=0;i--){ cout<<t[i]; } cout<<s[h-1]; } else{ for(int i=s.length()-1;i>=0;i--){ cout<<s[i]; } cout<<t[n-1]; } return 0; }