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