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