fork download
  1. int fuzzyStrcmp(char s[], char t[]){
  2. int i = 0,j = 0;
  3.  
  4. while(s[i] != '\0'){
  5. if(!((s[i] == t[i]) || (s[i] == t[i]+32) || (s[i] == t[i]-32))) j++;
  6. i ++;
  7. }
  8.  
  9. if((s[i] == t[i])&&(j == 0)) return 1;
  10.  
  11. return 0;
  12. }
  13.  
  14. //メイン関数は書き換えなくてできます
  15. int main(){
  16. int ans;
  17. char s[100];
  18. char t[100];
  19. scanf("%s %s",s,t);
  20. printf("%s = %s -> ",s,t);
  21. ans = fuzzyStrcmp(s,t);
  22. printf("%d\n",ans);
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0.01s 5284KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1