Cod sursa(job #116813)
Utilizator | Data | 19 decembrie 2007 17:08:03 | |
---|---|---|---|
Problema | Nunta | Scor | 60 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <fstream.h>
long a;
long long S,x1,x2;
int main()
{
ifstream fin("nunta.in");
ofstream fout("nunta.out");
fin>>a;
x1=1;
x2=2;
for (long i=2;i<a;i++)
{
S=x1+x2;
x1=x2;
x2=S;
}
fout<<S<<"\n" ;
fin.close();
fout.close();
return 0;
}