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