#include <iostream>
using namespace std;
int main() {
int n, t1 = 0, t2 = 1, next;
cout << "7: ";
cin >> n;
for (int i = 1; i <= n; ++i) {
cout << t1 << " ";
next = t1 + t2;
t1 = t2;
t2 = next;
}
return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: