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.  
  8. if (tolower((unsigned char)s[i]) != tolower((unsigned char)t[i])) {
  9. return 0;
  10. }
  11. i++;
  12. }
  13.  
  14.  
  15. if (s[i] == '\0' && t[i] == '\0') {
  16. return 1;
  17. }
  18.  
  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 5324KB
stdin
abx  Aby
stdout
abx = Aby -> 0