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