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