Одномерная динамика




Task
Вывести N-ое число Фибоначчи
Prohibited operators:for;while
Python
1
#include <iostream>    
2
using namespace std;    
3
long long A[10000];    
4
long long f(long long n) {    
5
	if (A[n] != 0)     
6
		return A[n];    
7
	if (n < 2) return n;    
8
	else {    
9
10
		return A[n];    
11
	}    
12
}    
13
int main()    
14
{    
15
	int n;    
16
	cin >> n;    
17
	cout << f(n);    
18
	return 0;    
19
}    
Your last submission is saved in the editor window.
     

Results:

All results: