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