#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int next = 1,
now = 1,
before = 0;
cout << now << ' ' << next << ' ';
for(int i = 0; i < 8; i++)
{
int temp = now;
next += now;
now += before;
before = temp;
cout << next << ' ';
}
cout << endl;
cin.get(); cin.get();
return 0;
}
Comments