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. 二分图最大匹配(匈牙利算法) POJ 3041 Asteroids

    题目传送门 /* 题意:每次能消灭一行或一列的障碍物,要求最少的次数. 匈牙利算法:把行和列看做两个集合,当有障碍物连接时连一条边,问题转换为最小点覆盖数==二分图最大匹配数 趣味入门:http:// ...

  2. ACM_区间调度问题(贪心)

    Meetings 系列一 Time Limit: 2000/1000ms (Java/Others) Problem Description: 多年之后的广财ACM编协如日中天,下系多个部门,且编协成 ...

  3. Windows平台下Oracle实例启动过程中日志输出

    Windows平台下Oracle实例启动过程中日志输出记录. 路径:D:\app\Administrator\diag\rdbms\orcl\orcl\trace\alert_orcl.log 输出内 ...

  4. .net中RSA加密解密

    1.产生密钥: private static void CreateKey() { using (RSACryptoServiceProvider rsa = new RSACryptoService ...

  5. FCC 基础JavaScript 练习4

    1.另一种数据类型是布尔(Boolean).布尔 值要么是true要么是false, 它非常像电路开关, true 是“开”,false是“关”.这两种状态是互斥的 2.伪代码 if(条件为真){ 语 ...

  6. V形

    <!doctype html><html><head><meta charset="utf-8"><title>无标题文 ...

  7. Pro ASP.NET Core MVC 6th 第三章

    第三章 MVC 模式,项目和约定 在深入了解ASP.NET Core MVC的细节之前,我想确保您熟悉MVC设计模式背后的思路以及将其转换为ASP.NET Core MVC项目的方式. 您可能已经了解 ...

  8. magento 购物车 首页 显示

    如何将购物车显示在你的首页 1.复制代码:<!--new block -->                <block type="checkout/cart_sideb ...

  9. DropDownList 递归绑定分子公司信息

    /// <summary> /// 绑定下拉框 /// </summary> /// <param name="ddl">绑定控件名称</ ...

  10. java项目其他基础配置

    创建完maven项目之后. 1.pom.xml文件配置项目相关的架包. 2.src.main.resources下边 创建文件夹:spring以及mapper. 3.src.main.resource ...