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