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