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

解题报告:用来陶冶情操的题,求a到b的三次方的和。

 1 #include<stdio.h>
 2 #include<string.h>
 3 #define INT __int64
 4 int main()
 5 {
 6     int T,kase = 1;
 7     scanf("%d",&T);
 8     INT a,b;
 9     while(T--)
10     {
11         scanf("%I64d%I64d",&a,&b);
12         INT sum = 0;
13         for(INT i = a;i <= b;++i)
14         sum += i * i * i;
15         printf("Case #%d: %I64d\n",kase++,sum);
16     }
17     return 0;
18 }
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2022-03-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-19
  • 2021-10-23
  • 2021-11-26
  • 2021-08-21
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
相关资源
相似解决方案