I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » Programming » C/C++ »

john\′s Photo
4 Dec 07, 2:20PM
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.
Currently you need to be logged in to leave a message.