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