於本部落格之

數學 -> 幾何 -> n個平面最多可分成幾個空間

有解說

 

#include <iostream>

using namespace std;

int main()
{
    int n;
    while (cin >> n)
    {
          n = (n*n*n + 5*n + 6)/6;
          cout << n << endl;
    }

    return 0;
}

arrow
arrow
    全站熱搜

    大神(偽) 發表在 痞客邦 留言(0) 人氣()