피보나치 수열

~cpp 
#include <iostream>
using namespace std;

int fivo(int);

int main()
{
	int input;
	cout << "입력 : ";
	cin >> input;
	cout << fivo(input) << endl;
	return 0;
}

int fivo(int i)
{
	if (i == 0)
		return 0;
	if (i == 1)
		return 1;
	return fivo(i-1) + fivo(i-2);
}

Retrieved from http://wiki.zeropage.org/wiki.php/피보나치/aekae
last modified 2021-02-07 05:31:29