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 = cs + 32;
  11. if (ct >= 'A' && ct <= 'Z') ct = ct + 32;
  12.  
  13. if (cs != ct) {
  14. return 0;
  15. }
  16. i++;
  17. }
  18.  
  19.  
  20. if (s[i] == '\0' && t[i] == '\0')
  21. return 1;
  22. else
  23. return 0;
  24. }
  25.  
  26. int main(){
  27. int ans;
  28. char s[100];
  29. char t[100];
  30. scanf("%s %s", s, t);
  31. printf("%s = %s -> ", s, t);
  32. ans = fuzzyStrcmp(s, t);
  33. printf("%d\n", ans);
  34. return 0;
  35. }
  36.  
  37.  
Success #stdin #stdout 0.01s 5300KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1