Cod sursa(job #356515)
Utilizator | Data | 14 octombrie 2009 23:33:07 | |
---|---|---|---|
Problema | Nunta | Scor | 0 |
Compilator | cpp | Status | done |
Runda | CNRV #2 | Marime | 0.27 kb |
#include <fstream.h>
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+1) {
c=a+b;
a=b;
b=c;
}
g<<c;
f.close();
g.close();
return 0;
}