fork download
  1. #include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]) {
  4. int i;
  5. for (i = 0; s[i] != '\0' && t[i] != '\0'; i++) {
  6. char cs = s[i];
  7. char ct = t[i];
  8.  
  9. if (cs >= 'a' && cs <= 'z') {
  10. cs = cs - 32;
  11. }
  12. if (ct >= 'a' && ct <= 'z') {
  13. ct = ct - 32;
  14. }
  15. if (cs != ct) {
  16. return 0;
  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. }
Success #stdin #stdout 0s 5316KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1