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