Fibonacci series in C++ can't get more than 47 numbers
问题 I designed this program that can print the Fibonacci Series ( series[i] = series[i-1] + series[i-2] ) but i can't get more than 47 numbers because the 48th they become negative and strange numbers (i think this happens when the list is out of range or the item is null): #include <iostream> #include <vector> using namespace std; int main () { int length; string again = ""; do { cout << "Enter the length you want in your sequence: "; cin >> length; vector<int> series(length); for (int n=0; n<=1