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