fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i = 0;
  5. while(s[i] != '\0' && t[i] != '\0') {
  6. char cs = s[i];
  7. char ct = t[i];
  8.  
  9. // 大文字を小文字に変換
  10. if(cs >= 'A' && cs <= 'Z') cs += 32;
  11. if(ct >= 'A' && ct <= 'Z') ct += 32;
  12.  
  13. if(cs != ct) return 0;
  14. i++;
  15. }
  16. if(s[i] == '\0' && t[i] == '\0') return 1;
  17. else return 0;
  18. }
  19.  
  20. int main(){
  21. int ans;
  22. char s[100];
  23. char t[100];
  24. scanf("%s %s",s,t);
  25. printf("%s = %s -> ",s,t);
  26. ans = fuzzyStrcmp(s,t);
  27. printf("%d\n",ans);
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 5296KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1