Run ID:145494
提交时间:2026-01-25 15:46:17
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ char a[1001],b[1001]; int s=0,n=0; cin>>a>>b; for(int i=0;i<strlen(a);i++){ if(a[i]>='0'&&a[i]<='9'){ s++; } } for(int j=0;j<strlen(b);j++){ if(b[j]>='0'&&b[j]<='9'){ n++; } } cout<<s<<' '<<n<<endl; if(s>n){ for(int k=strlen(b)-1;k>=0;k--){ cout<<b[k]; } cout<<a[s-1]; return 0; } else{ for(int k=strlen(a-1);k>=0;k--){ cout<<a[k]; } cout<<b[n-1]; } return 0; }