// Online C++ compiler to run C++ program online
#include <iostream>
using namespace std;
int fib(int n){
int arr[n]={0,1};
// arr[n]={0,1};
for(int i= 0 ;i<=n;i++){
// 0 1 1 2 3 5 8 13
arr[i+2]=arr[i]+arr[i+1];
cout << arr[i] << " ";
}
cout<< endl;
cout << arr[n];
return 0;
}
int main() {
fib(6);
return 0;
}
Ly8gT25saW5lIEMrKyBjb21waWxlciB0byBydW4gQysrIHByb2dyYW0gb25saW5lCiNpbmNsdWRlIDxpb3N0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IGZpYihpbnQgbil7CiAgICBpbnQgYXJyW25dPXswLDF9OwogICAgLy8gYXJyW25dPXswLDF9OwogICAgZm9yKGludCBpPSAwIDtpPD1uO2krKyl7CiAgICAgICAgLy8gMCAxIDEgMiAzIDUgOCAxMwogICAgICAgIGFycltpKzJdPWFycltpXSthcnJbaSsxXTsKICAgICAgICAgICBjb3V0IDw8IGFycltpXSA8PCAiICAiOwogICAgfQogICAgY291dDw8IGVuZGw7CiAgICBjb3V0IDw8IGFycltuXTsgCiAgICAgcmV0dXJuIDA7Cn0KaW50IG1haW4oKSB7CmZpYig2KTsKICAgIHJldHVybiAwOwp9