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