回答編集履歴
3
内容修正
test
CHANGED
@@ -42,7 +42,7 @@
|
|
42
42
|
|
43
43
|
scanf("%d",&k);
|
44
44
|
|
45
|
-
for (int i = k; i <= 100; i +=
|
45
|
+
for (int i = k; i <= 100; i += k) {
|
46
46
|
|
47
47
|
printf("%d\n",i);
|
48
48
|
|
2
追記
test
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
int sum = k;
|
16
16
|
|
17
|
-
while(sum<100){
|
17
|
+
while(sum<=100){
|
18
18
|
|
19
19
|
printf("%d\n",sum);
|
20
20
|
|
@@ -27,3 +27,29 @@
|
|
27
27
|
}
|
28
28
|
|
29
29
|
```
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
for文なら
|
34
|
+
|
35
|
+
```cpp
|
36
|
+
|
37
|
+
int main(void)
|
38
|
+
|
39
|
+
{
|
40
|
+
|
41
|
+
int k;
|
42
|
+
|
43
|
+
scanf("%d",&k);
|
44
|
+
|
45
|
+
for (int i = k; i <= 100; i += 5) {
|
46
|
+
|
47
|
+
printf("%d\n",i);
|
48
|
+
|
49
|
+
}
|
50
|
+
|
51
|
+
return 0;
|
52
|
+
|
53
|
+
}
|
54
|
+
|
55
|
+
```
|
1
コードの変更
test
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
```c
|
6
|
-
|
7
|
-
|
8
6
|
|
9
7
|
int main(void)
|
10
8
|
|
@@ -14,11 +12,13 @@
|
|
14
12
|
|
15
13
|
scanf("%d",&k);
|
16
14
|
|
17
|
-
int sum =
|
15
|
+
int sum = k;
|
18
16
|
|
19
17
|
while(sum<100){
|
20
18
|
|
21
|
-
printf("%d\n",sum
|
19
|
+
printf("%d\n",sum);
|
20
|
+
|
21
|
+
sum += k;
|
22
22
|
|
23
23
|
}
|
24
24
|
|