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