回答編集履歴
1
コードの変更
test
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
### 誤回答
|
2
|
+
|
1
3
|
```c
|
2
4
|
|
3
5
|
#include <stdio.h>
|
@@ -63,3 +65,73 @@
|
|
63
65
|
|
64
66
|
|
65
67
|
```
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
### 正回答
|
72
|
+
|
73
|
+
```c
|
74
|
+
|
75
|
+
#include <stdio.h>
|
76
|
+
|
77
|
+
#include <string.h>
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
int main(void)
|
82
|
+
|
83
|
+
{
|
84
|
+
|
85
|
+
int a=0,b=0,c=0;
|
86
|
+
|
87
|
+
int max = 100;
|
88
|
+
|
89
|
+
int min = 0;
|
90
|
+
|
91
|
+
char *key[3] = {"国語", "数学", "英語"};
|
92
|
+
|
93
|
+
char *pass[3] ={"入力エラー","合格","不合格"};
|
94
|
+
|
95
|
+
int number[3] = {a,b,c};
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
for (int i = 0;i< 3;i++){
|
100
|
+
|
101
|
+
printf("%s:",key[i]);
|
102
|
+
|
103
|
+
scanf("%d", &number[i]);
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
printf("***判定***\n");
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
for (int i = 0;i< 3;i++){
|
114
|
+
|
115
|
+
if(number[i] < min || number[i] > max){
|
116
|
+
|
117
|
+
printf("%s: %s\n",key[i],pass[0]);
|
118
|
+
|
119
|
+
}else if(number[i]>59){
|
120
|
+
|
121
|
+
printf( "%s: %s\n",key[i],pass[1]);
|
122
|
+
|
123
|
+
}else if (number[i] < 60){
|
124
|
+
|
125
|
+
printf( "%s: %s\n",key[i],pass[2]);
|
126
|
+
|
127
|
+
}
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
return 0;
|
132
|
+
|
133
|
+
}
|
134
|
+
|
135
|
+
```
|
136
|
+
|
137
|
+
これで合っていると思います。
|