|
Radbug
SUPREME DRINKER

| Joined: 16 Oct 2009 |
| Posts: 17 |
|
|
 |
#include <iostream.h>
#include <fstream.h>
ifstream fin("fib.in");
ofstream fout("fib.out");
unsigned long a,b,c,n;
int main()
{
fin>>n;
n=n-1;
a=1;
b=1;
c=a+b;
while (n>2)
{
a=b;
b=c;
c=a+b;
n=n-1;
}
fout<<c<< '\n';
fin.close();
fout.close();
return 0;
} |
|
|
|