回答編集履歴
2
コードの修正
test
CHANGED
@@ -4,17 +4,13 @@
|
|
4
4
|
|
5
5
|
{
|
6
6
|
|
7
|
-
|
7
|
+
int k, N = 10, j = 1;
|
8
8
|
|
9
|
-
|
9
|
+
double y = x, t = x;
|
10
10
|
|
11
|
-
|
11
|
+
for (k = 0; k < N; k++)
|
12
12
|
|
13
|
-
|
13
|
+
y += (t = -t * x * x) / (j += 2);
|
14
|
-
|
15
|
-
t = -t * x * x;
|
16
|
-
|
17
|
-
}
|
18
14
|
|
19
15
|
return y;
|
20
16
|
|
1
コードの修正
test
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
|
5
5
|
{
|
6
6
|
|
7
|
-
int N = 10,
|
7
|
+
int k, N = 10, j = -1;
|
8
8
|
|
9
9
|
double y = 0, t = x;
|
10
10
|
|
11
|
-
for (
|
11
|
+
for (k = 0; k <= N; k++) {
|
12
12
|
|
13
13
|
y += t / (j += 2);
|
14
14
|
|