Stuff
public cpp v1 · immutable#include <iostream>#include <vector>#include <sstream>using namespace std;class Fibs {public: Fibs() { t.push_back(0); t.push_back(1); } int operator[]( int n ) { while ( n >= t.size() ) { t.push_back( t.rbegin()[0] + t.rbegin()[1] ); } return t[n-1]; }protected: vector<int> t;};int main( int argc, char** argv ) { istringstream src; src.str( argv[1] ); int n; src >> n; Fibs f; cout << f[n] << endl;}