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