fork download
  1. #include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i = 0;
  5. char a, b;
  6.  
  7. while (s[i] != '\0' || t[i] != '\0') {
  8. a = s[i];
  9. b = t[i];
  10.  
  11. if (a >= 'A' && a <= 'Z')
  12. a = a + ('a' - 'A');
  13. if (b >= 'A' && b <= 'Z')
  14. b = b + ('a' - 'A');
  15.  
  16. if (a != b)
  17. return 0;
  18.  
  19. i++;
  20. }
  21.  
  22. return 1;
  23. }
  24.  
  25. int main(){
  26. int ans;
  27. char s[100];
  28. char t[100];
  29.  
  30. scanf("%s %s", s, t);
  31. printf("%s = %s -> ", s, t);
  32.  
  33. ans = fuzzyStrcmp(s, t);
  34. printf("%d\n", ans);
  35.  
  36. return 0;
  37. }
Success #stdin #stdout 0s 5316KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1