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