#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
string s1,s2;
int main(){
cin>>s1>>s2;
reverse(s1.begin(),s1.end());//反转字符串,头文件为<algorithm>
string s3=s1+s2;//string类型已重载运算符
cout<<s1.length()<<' '<<s2.length()<<' '<<s3.length()<<endl;//.length输出长度
cout<<s1<<endl<<s2<<endl<<s3<<endl;
char s[20];
strcpy(s,s3.c_str());//c_str()函数返回一个指向正规C字符串的指针, 内容与本string串相同,strcpy 在头文件为才cstring
cout<<s<<endl;
if(s3.find(s2,4)==-1){//找不到返回-1,第二个参数指定位置(下标) ,返回s3中第一次出现的整个s2的首元素的位置,效率比kmp低,在不是考察字符串匹配的情况下可用。
cout<<"can't find."<<endl;
}
else{
cout<<"can find."<<endl;
}
cout<<s3.find(s2)<<endl;//不指定位置,从头开始找
return 0;
}