Răspuns:
Explicație:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream f("fib.in");
ofstream f2("fib.out");
int n, a=1, b=1, c;
f >> n;
f2<< a<<" "<<b<<" ";
for(int i = 2; i<n;i++)
{
c=a+b;
a=b;
b=c;
f2<<c<<" ";
}
return 0;
}