help home work

Request
Complete the following program so that the long-long Fibrek (long long n) function recalculates the value of the nth Fibonacci number.
#include <iostream>

using namespace std;

int t, k;

long long Fibrek (int n)
{



}

int main ()
{
    cin >> t;
    while (t--)
    {
      cin >> k;
      cout << Fibrek (k) << "\ n";
    }
}

Entrance
In the first row there is a natural number t, not more than 35, denoting the number of queries.
In the second row there are t natural numbers n1, ..., which are larger than 35.
Exit
In the row, the value of the lower Fibonacci number is to be found.
Here is an example:
1
2
3
4
5
6
7
8
int i1 = 1, i2 = 1;
while (i1 < 200)
{
	int temp = i1;
	i1 = i1 + i2;
	i2 = temp;
	cout << i1 << " ";
}



2 3 5 8 13 21 34 55 89 144 233 
Last edited on
Topic archived. No new replies allowed.