HDU5053-the Sum of Cube-2014 ACM/ICPC Asia Regional Shanghai Online(水题求立方和)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5053

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<map>
#include<queue>
#include<cmath>
#include<stack>
#include<set>
#include<vector>
#include<algorithm>
#define LL __int64
#define inf 1<<29
#define s(a) scanf("%d",&a)
#define CL(a,b) memset(a,b,sizeof(a))
using namespace std;
const int N=200005;
int n,m,a,b,c;
int main()
{
    int t,Case=1;
    s(t);
    while(t--){
        LL sum=0,a,b;
        scanf("%I64d%I64d",&a,&b);
        for(LL i=a;i<=b;i++) sum+=i*i*i;
        printf("Case #%d: %I64d\n",Case++,sum);
    }
    return 0;
}


 

你可能感兴趣的:(HDU5053)