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