Cod sursa(job #1462074)
| Utilizator | Data | 17 iulie 2015 00:30:00 | |
|---|---|---|---|
| Problema | Nunta | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.29 kb |
#include<fstream>
using namespace std;
int main()
{
long long f1 = 1, f2 = 2;
ifstream in("nunta.in");
ofstream out("nunta.out");
int n;
in >> n;
for(int i = 3;i <= n;++i)
{
f2 = f1 + f2;
f1 = f2 - f1;
}
out<<f2<<"\n";
in.close();
out.close();
}
