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. return (s[i] == '\0' && t[i] == '\0') ? 1 : 0;
  13. }
  14.  
  15. int main(){
  16. int ans;
  17. char s[100];
  18. char t[100];
  19.  
  20. scanf("%s %s", s, t);
  21. printf("%s == %s -> ", s, t);
  22. ans = fuzzyStrcmp(s, t);
  23. printf("%d\n", ans);
  24.  
  25. return 0;
  26. }
  27.  
  28.  
Success #stdin #stdout 0s 5284KB
stdin
abCD AbCd
stdout
abCD == AbCd -> 1