#33053:


yp11152042@yphs.tp.edu.tw (911-06吳若旖)

School : 臺北市私立延平高級中學
ID : 197087
IP address : [203.72.178.3]
Last Login :
2024-12-09 13:58:14
a111. 12149 - Feynman -- UVa12149 | From: [203.72.178.2] | Post Date : 2022-11-25 13:21

#include<iostream>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		if(n==0) break;
		else if(n==1) cout<<1<<endl;
		else{
			int f=1;
			for(int i=2;i<=n;i++){
				f+=i*i;
			}
			cout<<f<<endl;
		}
	}
return 0;
}
 
ZeroJudge Forum