#include<iostream>
using namespace std;
int main()
{
int n, t1 = 0, t2 = 1, sum = 0;
cin >> n;
for (int i = 1; i <= n; i++)
{
if (i == 1)
cout << t1 << " ";
else if (i == 2)
cout << t2 << " ";
else
{
sum = t1 + t2;
cout << sum << " ";
t1 = t2;
t2 = sum;
}
}
return 0;
}
//1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,
int a=1,b=1;
cout<<a<<" "<<b<<" ";
for(int i=0;i<10;i++){
c=a+b;
a=b;
b=c;
cout<<c<<" ";
}
// 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
// a, b, c,......
// , a, b, c,.....
// , , a, b, c,....
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a = 0;
int b = 1;
int c = 1;
for(int i = 1; i<=n;i++){
c = a+b;
a = b;
b = c;
}
cout << c; // Here you can output the variable b or c, at the end of the for loop they are the same
// This outputs the N-th fibbonnaci number
return 0;
}
#include <bits/stdc++.h>
using namespace std ;
int main (){
int n,p1=0,p2=1,d;
cin>>n;
for( ;0<n;n--){
cout<<p1<<" ";
d=p1;
p1+=p2;
p2=d;
}
return 0;
}