fork download
  1. #include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i = 0;
  5.  
  6. while (s[i] != '\0' && t[i] != '\0') {
  7. char cs = s[i];
  8. char ct = t[i];
  9.  
  10. if (cs >= 'A' && cs <= 'Z') cs = cs + ('a' - 'A');
  11. if (ct >= 'A' && ct <= 'Z') ct = ct + ('a' - 'A');
  12.  
  13. if (cs != ct) {
  14. return 0;
  15. }
  16. i++;
  17. }
  18.  
  19. if (s[i] == '\0' && t[i] == '\0') {
  20. return 1;
  21. } else {
  22. return 0;
  23. }
  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.  
Success #stdin #stdout 0s 5332KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1