📄 13ii.cpp
字号:
#include <iostream.h>
// Fib() Returns the Fibonacci number corresponding to n
// IN: n is a positive integer
int Fib (int n)
{ int temp;
if (n < 2)
temp = 1; // trivial case
else
temp = Fib(n-1) + Fib(n-2); // recursive case with two calls
return (temp);
}
void main ()
{ int x;
cout << "enter a value: ";
cin >> x;
cout << "fibonacci is: " << Fib(x) << endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -