Try:
std::vector<int> row(n + 1); row[0] = 1; for (int j = 1; j <= n; j++) for (int i = j; i; row[i] += row[i - 1], i--); return row;Though depending on what you're doing with the data, you may want to just write the results to screen.
Login