回答編集履歴

2

コード修正

2020/06/15 11:46

投稿

SHOMI
SHOMI

スコア4079

test CHANGED
@@ -18,7 +18,9 @@
18
18
 
19
19
  - int sum = 0;
20
20
 
21
+ - sum = sum + i;
22
+
21
- sum = sum + cc[i];
23
+ + sum = sum + cc[i];
22
24
 
23
25
  }
24
26
 

1

書式修正

2020/06/15 11:46

投稿

SHOMI
SHOMI

スコア4079

test CHANGED
@@ -1,4 +1,4 @@
1
- ```C
1
+ ```diff
2
2
 
3
3
  #include <stdio.h>
4
4
 
@@ -10,15 +10,19 @@
10
10
 
11
11
  int i;
12
12
 
13
- int sum = 0;
13
+ + int sum = 0;
14
14
 
15
+ - for (i = 0; i <= 10; i = i + 1) {
16
+
15
- for (i = 0; i < 10; i = i + 1) {
17
+ + for (i = 0; i < 10; i = i + 1) {
18
+
19
+ - int sum = 0;
16
20
 
17
21
  sum = sum + cc[i];
18
22
 
19
23
  }
20
24
 
21
- printf("%d\n", sum);
25
+ + printf("%d\n", sum);
22
26
 
23
27
  return 0;
24
28