fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i,j=0;
  5. int ret=0;
  6.  
  7. for(i=0;s[i]!='\0';i++){
  8. if('a'<=s[i]&&s[i]<='z')
  9. s[i]=s[i]-32;
  10. }
  11. for(i=0;t[i]!='\0';i++){
  12. if('a'<=t[i]&&t[i]<='z')
  13. t[i]=t[i]-32;
  14. }
  15. while(1){
  16. if(s[j]!=t[j])
  17. break;
  18. else if(s[j]!='\0'&&t[j]=='\0')
  19. break;
  20. else if(t[j]!='\0'&&s[j]=='\0')
  21. break;
  22. else if(s[j]=='\0'&&t[j]=='\0'){
  23. ret=1;
  24. break;}
  25. j++;
  26.  
  27. }
  28. return ret;
  29. }
  30.  
  31. //メイン関数は書き換えなくてできます
  32. int main(){
  33. int ans;
  34. char s[100];
  35. char t[100];
  36. scanf("%s %s",s,t);
  37. printf("%s = %s -> ",s,t);
  38. ans = fuzzyStrcmp(s,t);
  39. printf("%d\n",ans);
  40. return 0;
  41. }
  42.  
Success #stdin #stdout 0s 5320KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1