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