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