回答編集履歴
1
コードの修正
test
CHANGED
@@ -72,9 +72,9 @@
|
|
72
72
|
|
73
73
|
else if (n == 1) f = 1;
|
74
74
|
|
75
|
-
else f = fibo(n-
|
75
|
+
else f = fibo(n-1) + fibo(n-2);
|
76
76
|
|
77
|
-
if (k <= n) {
|
77
|
+
if (k <= n && (k > 0 || n == 0)) {
|
78
78
|
|
79
79
|
printf("%d\n", f);
|
80
80
|
|