杭电 1012 u Calculate e【算阶乘】】的更多相关文章

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1012 解题思路:对阶乘递归求和 反思:前面3个的输出格式需要注意,可以自己单独打印出来,也可以在for循环里面更改输出小数的位数,另外读题还是要仔细,输出的有9位小数. #include<stdio.h> double sum(int n) { int i; double x=1,s=0; if(n==0) return 1; else { s=1; for(i=1;i<=n;i++) {…
主题 Calculate a + b 杭电OJ-1000 Input Each line will contain two integers A and B. Process to end of file. Output For each case, output A + B in one line. Mine #include <stdio.h> int main() { int a,b; while(~scanf("%d %d",&a,&b)) //多次…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1012 u Calculate e Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 52607    Accepted Submission(s): 24106 Problem Description A simple mathematical…
杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze 广度搜索1006 Redraiment猜想 数论:容斥定理1007 童年生活二三事 递推题1008 University 简单hash1009 目标柏林 简单模拟题1010 Rails 模拟题(堆栈)1011 Box of Bricks 简单题1012 IMMEDIATE DECODABILITY…
最近在尝试做acm试题,刚刚是1001题就把我困住了,这是题目: Problem Description In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.   Input The input will consist of a series of integers n, one integer per line   Output For each case, output SUM(n) in one…
杭电ACM2076--夹角有多大(题目已修改,注意读题) http://acm.hdu.edu.cn/showproblem.php?pid=2076 思路很简单.直接贴代码.过程分析有点耗时间. // #include <stdio.h> // #include <math.h> // int main() // { // int t; // double h,m,s; // //int h,m,s; // int z; // scanf("%d",&…
杭电ACM2092--整数解    分析 http://acm.hdu.edu.cn/showproblem.php?pid=2092 一个YES,一个Yes.试了10几次..我也是无语了..哪里都不错的.... 很简单,用2次求根公式求出其中一个的值,然后判断是否为整数    if (x == int(x) ). 或者  用最直接的方法,从-m到m挨个算.有意结果时停止. 源码:   #include <stdio.h> #include <math.h> int main()…
杭电ACM(1002)大数相加 A + B Problem II Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. InputThe first line of the input contains an integer T(1<=T<=20) which means the number…
阿牛的EOF牛肉串 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 20247    Accepted Submission(s): 9495 Problem Description 今年的ACM暑期集训队一共同拥有18人.分为6支队伍.当中有一个叫做EOF的队伍,由04级的阿牛.XC以及05级的COY组成.在共同的集训生活中,大家建立…
Help Johnny(类似杭电3568题) Description Poor Johnny is so busy this term. His tutor threw lots of hard problems to him and demanded him to  accomplish those problems in a month. What a wicked tutor! After cursing his tutor thousands of times,  Johnny real…