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