fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i;
  5. for(i=0;s[i]!='\0'&&t[i]!='\0';i++){
  6. char cs=s[i],ct=t[i];
  7. if(cs>='A'&&cs<='Z')
  8. cs=cs+('a'-'A');
  9. if(ct>='A'&&ct<='Z')
  10. ct=ct+('a'-'A');
  11. if(cs!=ct)
  12. return 0;
  13. }
  14. if(s[i]=='\0'&&t[i]=='\0')
  15. return 1;
  16. else return 0;
  17. }
  18.  
  19. int main(){
  20. int ans;
  21. char s[100];
  22. char t[100];
  23. scanf("%s %s",s,t);
  24. printf("%s = %s -> ",s,t);
  25. ans = fuzzyStrcmp(s,t);
  26. printf("%d\n",ans);
  27. return 0;
  28. }
Success #stdin #stdout 0s 5304KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1