- #include<bits/stdc++.h>
- using namespace std;
- string str1,str2;
- int main()
- {
- cin>>str1>>str2;
- int len1=str1.length();
- int len2=str2.length();
- if(len1<3 or len1>20 or len2<3 or len2>20)
- {
- cout<<"error"<<endl;
- }
- else{
- cout<<len1<<endl;
- cout<<len2<<endl;
- for(int i=len2-1;i>=0;i--){
- cout<<str2[i];
- }
- for(int i=len1-1;i>=0;i--){
- cout<<str1[i];
- }
- }
- return 0;
- }
複製代碼 |