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