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