# include <stdio.h>
int fuzzyStrcmp(char s[], char t[]){
int i=0;
int ret = 1;
while(1){
//①大文字小文字区別付けづに比較して一致していない場合 → 違う文字列
if(s[i]!=t[i] && s[i]-32!=t[i] && s[i]+32!=t[i]){
ret = 0;
break;
}
//②sは終端文字だが,tは終端文字でない場合 → 違う文字列
else if(s[i+1]=='\0' && t[i+1]!='\0'){
ret = 0;
break;
}
//③sは終端文字でないが,tは終端文字の場合 → 違う文字列
else if(s[i+1]!='\0' && t[i+1]=='\0'){
ret = 0;
break;
}
//④sもtも終端文字
else if(s[i+1]=='\0' && t[i+1]=='\0'){
break;
}
i++;
}
return ret;
}
int main(){
int ans;
char s[100];
char t[100];
ans = fuzzyStrcmp(s,t);
printf("%s = %s -> %d\n",s
,t
,ans
); return 0;
}
IyBpbmNsdWRlIDxzdGRpby5oPgoKaW50IGZ1enp5U3RyY21wKGNoYXIgc1tdLCBjaGFyIHRbXSl7CiAgICBpbnQgaT0wOwogICAgaW50IHJldCA9IDE7CiAgICB3aGlsZSgxKXsKICAgICAgICAvL+KRoOWkp+aWh+Wtl+Wwj+aWh+Wtl+WMuuWIpeS7mOOBkeOBpeOBq+avlOi8g+OBl+OBpuS4gOiHtOOBl+OBpuOBhOOBquOBhOWgtOWQiCDihpIg6YGV44GG5paH5a2X5YiXCiAgICAgICAgaWYoc1tpXSE9dFtpXSAmJiBzW2ldLTMyIT10W2ldICYmIHNbaV0rMzIhPXRbaV0pewogICAgICAgICAgICByZXQgPSAwOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgLy/ikaHvvZPjga/ntYLnq6/mloflrZfjgaDjgYzvvIx044Gv57WC56uv5paH5a2X44Gn44Gq44GE5aC05ZCIIOKGkiDpgZXjgYbmloflrZfliJcKICAgICAgICBlbHNlIGlmKHNbaSsxXT09J1wwJyAmJiB0W2krMV0hPSdcMCcpewogICAgICAgICAgICByZXQgPSAwOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgLy/ikaLvvZPjga/ntYLnq6/mloflrZfjgafjgarjgYTjgYzvvIzvvZTjga/ntYLnq6/mloflrZfjga7loLTlkIgg4oaSIOmBleOBhuaWh+Wtl+WIlwogICAgICAgIGVsc2UgaWYoc1tpKzFdIT0nXDAnICYmIHRbaSsxXT09J1wwJyl7CiAgICAgICAgICAgIHJldCA9IDA7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICAvL+KRo++9k+OCgu+9lOOCgue1guerr+aWh+WtlwogICAgICAgIGVsc2UgaWYoc1tpKzFdPT0nXDAnICYmIHRbaSsxXT09J1wwJyl7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBpKys7CiAgICB9CiAgICByZXR1cm4gcmV0Owp9CgppbnQgbWFpbigpewogICAgaW50IGFuczsKICAgIGNoYXIgc1sxMDBdOwogICAgY2hhciB0WzEwMF07CiAgICBzY2FuZigiJXMgJXMiLHMsdCk7CiAgICBhbnMgPSBmdXp6eVN0cmNtcChzLHQpOwogICAgcHJpbnRmKCIlcyA9ICVzIC0+ICVkXG4iLHMsdCxhbnMpOwogICAgcmV0dXJuIDA7Cn0=