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];
  7. char ct = t[i];
  8.  
  9. if(cs >= 'a' && cs <= 'z'){
  10. cs = cs - 32;
  11. }
  12. if(ct >= 'a' && ct <= 'z'){
  13. ct = ct - 32;
  14. }
  15. if(cs != ct){
  16. return 0;
  17. }
  18. }
  19. if (s[i] == '\0' && t[i] == '\0') {
  20. return 1;
  21. } else {
  22. return 0;
  23. }
  24. }
  25. int main(){
  26. int ans;
  27. char s[100];
  28. char t[100];
  29. scanf("%s %s",s,t);
  30. printf("%s = %s -> ",s,t);
  31. ans = fuzzyStrcmp(s,t);
  32. printf("%d\n",ans);
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0.01s 5280KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1