U E D R , A S I H C RSS

피보나치/김진목

~cpp #include <stdio.h>

int pres=1, prev=0, temp, i, n ;

int main(int argc, char *argv[])
{
    printf("숫자를 입력해보셈 ㅋㅋ  :  ");
    scanf("%d", &n);
    n -= 1;
    
    for(i=1;i<=n;i++)
    {
    temp=pres;
    pres += prev;
    prev=temp;
    }
    
    
  printf("결과 : %d", pres);
  system("PAUSE");	
  return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2009-05-27 07:09:19
Processing time 0.0916 sec