fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i=0;
  5. for(i=0;s[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. i=0;
  16. while(s[i] != '\0' && t[i] != '\0' && s[i] == t[i]){
  17. i++;
  18. }
  19. if(s[i]=='\0'&&t[i]=='\0'){
  20. return 1;
  21. }
  22. else{ return 0;}
  23. }
  24.  
  25.  
  26. int main(){
  27. int ans;
  28. char s[100];
  29. char t[100];
  30. scanf("%s %s",s,t);
  31. printf("%s = %s -> ",s,t);
  32. ans = fuzzyStrcmp(s,t);
  33. printf("%d\n",ans);
  34. return 0;
  35. }
  36.  
Success #stdin #stdout 0s 5288KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1