#45810:


chen971023@gmail.com (ZiaynGZiyaNG)

學校 : 國立臺南第二高級中學
編號 : 291750
來源 : [1.172.123.126]
最後登入時間 :
2025-05-12 19:07:06
a111. 12149 - Feynman -- UVa12149 | From: [122.121.184.46] | 發表日期 : 2025-04-15 21:26

就數學

#include <iostream>

using namespace std;

 

int main()

{

while (true)

{

int N;

cin >> N;

if (N == 0)

{

break;

}

 

cout << (N) * (N + 1) * (2 * N + 1) / 6 << endl;

 

}

}

 
ZeroJudge Forum