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