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