Code=ing
2013年12月6日 星期五
[UVA] 10302 - Summation of Polynomials
#include<stdio.h>
#include<algorithm>
using namespace std;
long long int s[50005];
int main(){
int n;
long long int i;
s[0]=0;
for(i=1;i<=50000;i++)
s[i]=s[i-1]+i*i*i;
while(scanf("%d",&n)!=EOF){
printf("%lld\n",s[n]);
}
}
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言