피보나치 수열 소스코드

From IT Wiki
Revision as of 13:04, 6 May 2018 by Itwiki (talk | contribs)

C언어

#include <stdio.h>
int fib(int n) { 
  if(n<=1) return n; 
  else return fib(n-1)+fib(n-2);
} 

int main() { 
  printf("%d", fib(35)); 
}