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