fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. int fuzzyStrcmp(char s[], char t[]) {
  5. int i = 0;
  6. while (s[i] != '\0' || t[i] != '\0') {
  7. char s_char = s[i];
  8. char t_char = t[i];
  9. if (s_char >= 'A' && s_char <= 'Z') {
  10. s_char += 32;
  11. }
  12. if (t_char >= 'A' && t_char <= 'Z') {
  13. t_char += 32;
  14. }
  15. if (s_char != t_char) {
  16. return 0;
  17. }
  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. scanf("%s %s", s, t);
  30. printf("%s = %s -> ", s, t);
  31. ans = fuzzyStrcmp(s, t);
  32. printf("%d\n", ans);
  33.  
  34. return 0;
  35. }
Success #stdin #stdout 0.01s 5288KB
stdin
abC  Abc

stdout
abC = Abc -> 1