Cod sursa(job #934898)
Utilizator | Data | 31 martie 2013 20:26:23 | |
---|---|---|---|
Problema | Nunta | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <fstream>
#define LL long long
using namespace std;
ifstream f("nunta.in"); ofstream g("nunta.out");
int n;
LL a = 1, b = 2, c;
inline LL solve() {
for(int i = 3 ; i <= n; ++i) c = a + b, a = b, b = c;
return c;
}
int main() {
f >> n;
g << solve() << '\n';
g.close();
return 0;
}