Cod sursa(job #3189530)
Utilizator | Data | 6 ianuarie 2024 07:41:18 | |
---|---|---|---|
Problema | Arbore partial de cost minim | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.23 kb |
#include <iostream>
using namespace std;
int f(int n)
{
if (n <= 1) return n;
else return f(n-1) + f(n-2);
}
int main()
{
for(int i = 0; i < 1000; i++) {
cout << i << ": " << f(i) << endl;
}
return 0;
}