Problem Description
Calculate S(n).

S(n)=13+23 +33 +......+n3 .

 
Input
Each line will contain one integer N(1 < n < 1000000000). Process to end of file.
 
Output
For each case, output the last four dights of S(N) in one line.
 
Sample Input
1
2
 
Sample Output
0001
0009
 
 #include <stdio.h>   // 运用数学公式:1^3 +2^3 +3^3 +……+n^3 =[n(n+1)/2]^2

 int main(){
int n;
int result; while(scanf("%d",&n)!=EOF){
n=n%;
result=(n*(n+)/)%;
result=(result*result)%; printf("%04d\n",result);
} return ;
}

Calculate S(n)的更多相关文章

  1. [转] PHP计算两个坐标之间的距离, Calculate the Distance Between Two Points in PHP

    Calculate the Distance Between Two Points in PHP There are a lot of applications where it is useful ...

  2. CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved

    CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin ...

  3. maven -- 问题解决(二)解决“Could not calculate build plan”问题

    错误提示如下:(eclipse+maven) Could not calculate build plan: Failure to transfer org.apache.maven.plugins: ...

  4. 线段树 + 矩阵 --- ZOJ 3772 Calculate the Function

    Calculate the Function Problem's Link:   http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCod ...

  5. hdu 1012:u Calculate e(数学题,水题)

    u Calculate e Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tot ...

  6. Calculate its MTBF assuming 2000 FITS for each DRAM

    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION A common unit of meas ...

  7. u Calculate e 分类: HDU 2015-06-19 22:18 14人阅读 评论(0) 收藏

    u Calculate e Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total ...

  8. How to calculate a good InnoDB log file size

    Peter wrote a post a while ago about choosing a good InnoDB log file size.  Not to pick on Peter, b ...

  9. Calculate the formula

    Problem Description You just need to calculate the sum of the formula: 1^2+3^2+5^2+……+ n ^2.   Input ...

  10. How to Calculate difference between two dates in C# z

    Do you need to find the difference in number of days, hours or even minute between the two date rang ...

随机推荐

  1. 2017杭电多校第五场Rikka with Subset

    Rikka with Subset Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others ...

  2. 最大流增广路(KM算法) HDOJ 1533 Going Home

    题目传送门 /* 最小费用流:KM算法是求最大流,只要w = -w就可以了,很经典的方法 */ #include <cstdio> #include <cmath> #incl ...

  3. Python的I/O操作

    1.读取键盘输入 msg = raw_input("Please enter :") print "you input ",msg #可接受Python表达式作 ...

  4. 专题九:实现类似QQ的即时通信程序

    引言: 前面专题中介绍了UDP.TCP和P2P编程,并且通过一些小的示例来让大家更好的理解它们的工作原理以及怎样.Net类库去实现它们的.为了让大家更好的理解我们平常中常见的软件QQ的工作原理,所以在 ...

  5. .Net实战之反射操作篇

    1.上一讲中描述了反射中常见的类,仅仅是描述类与反射之间的关系.   但是实际是对数据的操作,  在反射中,数据如何操作? [MyTable("T_UserInfo")] publ ...

  6. P2668 斗地主 dp+深搜版

    题目描述 牛牛最近迷上了一种叫斗地主的扑克游戏.斗地主是一种使用黑桃.红心.梅花.方片的A到K加上大小王的共54张牌来进行的扑克牌游戏.在斗地主中,牌的大小关系根据牌的数码表示如下:3<4< ...

  7. Selenium示例集锦--常见元素识别方法、下拉框、文本域及富文本框、鼠标操作、一组元素定位、弹窗、多窗口处理、JS、frame、文件上传和下载

    元素定位及其他操作 0.常见的识别元素的方法是什么? driver.find_element_by_id() driver.find_element_by_name() driver.find_ele ...

  8. Eclipse 编译java文件后出错 左树无红叉

    问题描述: 今天遇见让人郁闷的问题,在项目工程中java文件编译通不过,eclipse在java文件中标示错误,但是却不不能在navigator的视图中像平常一样出现小红叉.通过clean proje ...

  9. JS实现LOGO像雪花一样落下特效

    <HTML><HEAD><TITLE>LOGO从上落下</TITLE> <SCRIPT language=JavaScript> //窗口改 ...

  10. DIV自动居中

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...