#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
usingnamespace std;
vector<int> fib(int n) //# return Fibonacci series up to n
//"""Return a list containing the Fibonacci series up to n."""
{
vector <int> result;
int a, b;
a=0;
b=1;
while (a < n)
{
result.push_back(a);
n = a + b;
a = b;
b = n;
}
return result;
}
int main()
{
int n2,z;
n2 = 400000;
z = fib(n2);
cout << z << endl;
}
I get the following error when running the code: '=': cannot convert from 'std::vector<int,std::allocator<_Ty>>' to 'int'