~cpp 
#include <iostream>  
using namespace std;  
int pivona(int x);  
int main()  
{  
        int input; 
        cout << "수를 입력하시오:"; 
        cin >> input; 
        cout << pivona(input); 
        cout << endl; 
        return 0; 
} 
int pivona(int x) 
{ 
        if(x==0) 
                return 0; 
        if(x==1) 
                return 1; 
        return pivona(x-2) + pivona(x-1); 
} 


Retrieved from http://wiki.zeropage.org/wiki.php/피보나치/김상윤
last modified 2021-02-07 05:31:27