Răspuns:
#include <iostream>
using namespace std;
int main()
{
int a,b,n,f3,modul;
cin>>a;
cin>>b;
cin>>n;
cout<<a<<" "<<b<<" ";
f3=a+b;
do
{
if (f3<0)
modul=-f3;
else modul=f3;
if (modul<=n)
{
cout<<f3<<" ";
a=b;
b=f3;
f3=a+b;
}
} while (modul<=n);
return 0;
}