Cod sursa(job #356523)
Utilizator | Data | 14 octombrie 2009 23:44:39 | |
---|---|---|---|
Problema | Nunta | Scor | 0 |
Compilator | cpp | Status | done |
Runda | CNRV #2 | Marime | 0.31 kb |
#include <fstream>
#include <iostream>
using namespace std;
int main () {
long long n,a,b,c;
ifstream f("nunta.in");
ofstream g("nunta.out");
f>>n;
a=1; b=1;
while (a+b<=n) {
c=a+b;
a=b;
b=c;
}
cout<<c;
f.close();
g.close();
return 0;
}