fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[])
  4. {
  5. int i;
  6. for(i=0; s[i]!='\0' ; i++)
  7. {
  8. if(s[i]!=t[i])
  9. {
  10. if('A'<=s[i] && s[i]<='Z')
  11. {
  12. if(s[i]+32!=t[i])
  13. return 0;
  14. }
  15. else if('a'<=s[i] && s[i]<='z')
  16. {
  17. if(s[i]-32!=t[i])
  18. return 0;
  19. }
  20. }
  21. }
  22. if(t[i] != '\0')
  23. return 0;
  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 0.01s 5308KB
stdin
abND Abndef
stdout
abND = Abndef -> 0