fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. //関数の中だけを書き換えてください
  5. //同じとき1を返す,異なるとき0を返す
  6. int i;
  7. for(i=0;s[i]!='\0'||t[i]!='\0';i++){
  8. char a = s[i];
  9. char b = t[i];
  10.  
  11. if(a>='A'&& a<='Z') a = a + ('a'-'A');
  12. if(b>='A'&& b<='Z') b = b + ('a'-'A');
  13.  
  14. if(a != b)return 0;
  15. }
  16. return 1;
  17. }
  18.  
  19. //メイン関数は書き換えなくてできます
  20. int main(){
  21. int ans;
  22. char s[100];
  23. char t[100];
  24. scanf("%s %s",s,t);
  25. printf("%s = %s -> ",s,t);
  26. ans = fuzzyStrcmp(s,t);
  27. printf("%d\n",ans);
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0.01s 5288KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1