質問編集履歴
1
i,k,lの初期化として1を代入しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
double k(int x)
|
10
10
|
{
|
11
|
-
int i,k,l;
|
11
|
+
int i,k=1,l=1;
|
12
12
|
|
13
13
|
for(i=0;i<x;i++){
|
14
14
|
k=k*l;
|
@@ -19,14 +19,14 @@
|
|
19
19
|
|
20
20
|
double myexp(double x,int n)
|
21
21
|
{
|
22
|
-
int i;
|
22
|
+
int i=1;
|
23
23
|
double y;
|
24
24
|
double e;
|
25
25
|
|
26
26
|
e=1;
|
27
27
|
y=pow(x,i);
|
28
28
|
|
29
|
-
for(i=
|
29
|
+
for(i=1;i<N;i++){
|
30
30
|
e=e+(y/(k(i)));
|
31
31
|
}
|
32
32
|
return e;
|