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