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. char lower_s = tolower(s[i]);
  8. char lower_t = tolower(t[i]);
  9.  
  10. if (lower_s != lower_t) {
  11. return 0;
  12. }
  13. i++;
  14. }
  15.  
  16. if (s[i] == '\0' && t[i] == '\0') {
  17. return 1;
  18. } else {
  19. return 0;
  20. }
  21. }
  22.  
  23. int main(){
  24. int ans;
  25. char s[100];
  26. char t[100];
  27. scanf("%s %s",s,t);
  28. printf("%s = %s -> ",s,t);
  29. ans = fuzzyStrcmp(s,t);
  30. printf("%d\n",ans);
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
@��%� =  -> 0