fork download
  1. #include <stdio.h>
  2. #include <ctype.h>
  3.  
  4. int fuzzyStrcmp(char s[], char t[]) {
  5. int i = 0;
  6. while (s[i] != '\0' && t[i] != '\0') {
  7. if (tolower(s[i]) != tolower(t[i])) {
  8. return 0;
  9. }
  10. i++;
  11. }
  12. if (s[i] == '\0' && t[i] == '\0') {
  13. return 1;
  14. } else {
  15. return 0;
  16. }
  17. }
  18.  
  19. int main() {
  20. int ans;
  21. char s[100];
  22. char t[100];
  23. scanf("%s %s", s, t);
  24. printf("%s = %s -> ", s, t);
  25. ans = fuzzyStrcmp(s, t);
  26. printf("%d\n", ans);
  27. return 0;
  28. }
  29.  
  30.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
���# =  -> 0