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); }