No older revisions available
No older revisions available
소스 ¶
~cpp #include <iostream> using namespace std; int fibo(int); int main(){ while(true) { int input; cout << "숫자를 입력하시오 : "; do{ cin >> input; if(input <= 0) return 0; }while(input <= 0); cout << input <<"번째 숫자는 "<< fibo(input) << " 입니다.\n"; } return 0; } int fibo(int in){ if(in == 1 || in == 2) return 1; else return fibo(in-1) + fibo(in-2); }