~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;
}
Retrieved from http://wiki.zeropage.org/wiki.php/피보나치/김진목
last modified 2021-02-07 05:31:28