hdu 5053 the Sum of Cube(水)
2015-07-29 00:08
357 查看
题目链接:hdu 5053 the Sum of Cube
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
int main () {
int cas;
scanf("%d", &cas);
for (int kcas = 1; kcas <= cas; kcas++) {
ll A, B, S = 0;
scanf("%I64d%I64d", &A, &B);
for (ll i = A; i <= B; i++)
S += i * i * i;
printf("Case #%d: %I64d\n", kcas, S);
}
return 0;
}
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
int main () {
int cas;
scanf("%d", &cas);
for (int kcas = 1; kcas <= cas; kcas++) {
ll A, B, S = 0;
scanf("%I64d%I64d", &A, &B);
for (ll i = A; i <= B; i++)
S += i * i * i;
printf("Case #%d: %I64d\n", kcas, S);
}
return 0;
}
相关文章推荐
- nyoj 757 期末考试 【STL 优先队列】
- 搬家啦
- 关于迭代测试的一些思考
- CodeForces 5C - Longest Regular Bracket Sequence
- 关于迭代测试的一些思考
- 开始
- 【算法学习笔记】87. 枚举路径 SJTU OJ 1999 二哥找宝藏
- cf 443B Kolya and Tandem Repeat
- HDU 1087
- poj 2135 有流量限制的最小费用最大流
- Android中滑屏实现----手把手教你如何实现触摸滑屏以及Scroller类详解
- 在matlab中进行地理坐标和像素坐标的相互转换
- 点对点 客户端-服务器 聊天程序
- hdu 5035 Delivery(期望)
- PAT乙级 1015. 德才论
- C++对象模型——关键词所带来的差异(第一章)
- 磁盘读写
- Ext store中使用回调函数
- linux下解压iso文件
- Android开机键失灵启动手机的解决办法