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(s[i]=='\0'||t[i]=='\0')return 0;
  7. if('a' <= s[i] && s[i] <= 'z'){
  8. if(t[i]!=s[i]-32)return 0;
  9. }
  10. if('A' <= s[i] && s[i] <= 'Z'){
  11. if(t[i]!=s[i]+32)return 0;
  12. }
  13. if('a' <= t[i] && t[i] <= 'z'){
  14. if(s[i]!=t[i]-32)return 0;
  15. }
  16. if('A' <= t[i] && t[i] <= 'Z'){
  17. if(s[i]!=t[i]+32)return 0;
  18. }
  19. i++;
  20. }
  21. return 1;
  22. }
  23.  
  24. int main(){
  25. int ans;
  26. char s[100];
  27. char t[100];
  28. scanf("%s %s",s,t);
  29. printf("%s = %s -> ",s,t);
  30. ans = fuzzyStrcmp(s,t);
  31. printf("%d\n",ans);
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 5336KB
stdin
abcd
aBc
stdout
abcd = aBc -> 1