Run ID:76954

提交时间:2024-06-06 19:13:50

#include<iostream>//0=65 #include<cstring> using namespace std; int main(){ int c=0,d=0; char s[1000],t[1000]; cin.getline(s,1000); cin.getline(t,1000); for(int i=0;strlen(s)>i;i++){ if(s[i]>='0' && s[i]<='9'){ c++; } } for(int i=0;strlen(t)>i;i++){ if(t[i]>='0' && t[i]<='9'){ d++; } } if(c>d){ for(int i=strlen(t)-1;0<=i;i--) cout<<t[i]; cout<<s[c-1]; } else{ for(int i=strlen(s)-1;0<=i;i--) cout<<s[i]; cout<<t[d-1]; } return 0; }