fork download
  1. #include <stdio.h>
  2. #include <ctype.h> // tolower関数を使うために必要
  3.  
  4. int fuzzyStrcmp(char s[], char t[]){
  5. int i = 0;
  6.  
  7. while (s[i] != '\0' && t[i] != '\0') {
  8. if (tolower(s[i]) != tolower(t[i])) {
  9. return 0;
  10. }
  11. i++;
  12. }
  13.  
  14. return (s[i] == '\0' && t[i] == '\0') ? 1 : 0;
  15. }
  16.  
  17. int main(){
  18. int ans;
  19. char s[100];
  20. char t[100];
  21. scanf("%s %s",s,t);
  22. printf("%s = %s -> ",s,t);
  23. ans = fuzzyStrcmp(s,t);
  24. printf("%d\n",ans);
  25. return 0;
  26. }
  27.  
  28.  
Success #stdin #stdout 0s 5280KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1