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