U E D R , A S I H C RSS

피보나치/현정,현지

~cpp 
#include <stdio.h>


//피보나치라 -_- ㅠㅠ

int suyul[1000],i,num;


void pivo()
{
     suyul[0]=1;
     suyul[1]=1;
     for(i=2;i<1000;i++)
     suyul[i]=suyul[i-2]+suyul[i-1];
}

void main()
{
printf("알고싶은 '항'을 입력해주세염!\nNumber : ");

scanf(" %d",&num);

pivo();

printf("%d항의 숫자는 %d입니다.\n",num,suyul[num-1]); 

}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2009-05-27 07:09:19
Processing time 0.0916 sec