송수�
피보나치
ë�°ë¸”ìŠ¤ìº í”„2005/월요ì�¼ì—�서 ë§Œë“ C언어 피보나치 ì˜ˆì œ
피보나치
ë�°ë¸”ìŠ¤ìº í”„2005/월요ì�¼ì—�서 ë§Œë“ C언어 피보나치 ì˜ˆì œ
~cpp
#include <stdio.h>
int main(){
int num_prev=1;
int num_next=1;
int num_temp=0;
int pvio=0;
int count;
printf("숫ìž�를 ìž…ë ¥ 하세요:");
scanf("%d", &pvio);
count = pvio;
while(1)
{
num_temp =num_prev + num_next;
num_prev = num_next;
num_next = num_temp;
count-- ;
printf("%d\n",num_prev);
if (count == 0)
break;
}
return 0;
}










