피보나치 수열 소스코드

From CS Wiki
Revision as of 23:04, 5 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)); 
}