Pergunta de entrevista da empresa Intel Corporation

How would you make a recursive fibonacci sequence in c++?

Resposta da entrevista

Sigiloso

5 de nov. de 2015

int fib(int x) { if (x == 0) return 0; if (x == 1) return 1; return fib(x-1)+fib(x-2); }

1