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