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