解题思路:
注意事项:
参考代码:
#include <iostream> #include <string> using namespace std; int main(){ string str1,str2; int f=1;//标记是否判断完 cin>>str1>>str2; if(str1.size()==str2.size()){ if(str1==str2){//相等 cout<<2<<endl; f=0; } for(int i=0;i<str1.size();i++){//判断是否为不区分大小的同一字母 if(str1[i]!=str2[i] && abs(str1[i]-str2[i])!=32){ cout<<4<<endl; f=0; break; } } if(f){ cout<<3<<endl; } }else{ cout<<1<<endl; } return 0; }
0.0分
0 人评分