me and my amateur code again :$ This time if works somewhat fine, but gives a error table. any ideas mates?
#include <iostream>
using namespace std;
long fib_sk(int);
int fib_mas(int);
//===========================
int main()
{
int iSk;
cout<< "element count- "; cin>> iSk;
if (iSk<0) { cout<< "need positive value "; return 0; }
cout<< "fibonacci number array till " << iSk << "th element:" <<endl;
cout<< fib_mas(iSk) <<endl;
return 0;
}
//===========================
long fib_sk(int n)
{
if (n<2) { return n; }
else { return fib_sk(n-1) + fib_sk(n-2); }
}
//============================
int fib_mas(int m)
{
int *iMas;
iMas=new int(m);
for (int i=1; i<=m; i++)
{
iMas[i]=fib_sk(i);
cout<< iMas[i] << " ";
}
return 0;
}