U E D R , A S I H C RSS

피보나치/손동일

No older revisions available

No older revisions available



피보나치 수열



~cpp 
#include<iostream>
using namespace std;

int abc(int x);

void main()
{
	cout << "몇번째 숫자를 출력합니까?: " ;
	int a;
	cin >> a;
	cout << abc(a);
}


int abc(int x)
{
	return x<3 ? (x<2 ?1:2): abc(x-2) + abc(x-1);

}


-------------
피보나치
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:28
Processing time 0.0163 sec