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 s_chan = (s[i] >= 'A' && s[i] <= 'Z') ? s[i] + ('a' - 'A') : s[i];
  7. char t_chan = (t[i] >= 'A' && t[i] <= 'Z') ? t[i] + ('a' - 'A') : t[i];
  8.  
  9. if (s_chan != t_chan) {
  10. return 0;
  11. }
  12. }
  13. return 1;
  14. }
  15.  
  16. int main(){
  17. int ans;
  18. char s[100];
  19. char t[100];
  20. scanf("%s %s",s,t);
  21. printf("%s = %s -> ",s,t);
  22. ans = fuzzyStrcmp(s,t);
  23. printf("%d\n",ans);
  24. return 0;
  25. }
Success #stdin #stdout 0s 5280KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1