Welcome To SDIBT ACM-ICPC Online Judge

VIRTUAL JUDGE Recent Contest F.A.Qs Forum Home ProblemSet Status Ranklist Contest LoginRegister Exam
Problem 1949. -- 2006年春浙江省计算机等级考试二级C 编程题(2)

2006年春浙江省计算机等级考试二级C 编程题(2)

Time Limit: 1 Sec  Memory Limit: 125 MB
Submit: 569  Solved: 253
[Submit][Status][Forum]

Description

编写程序,输入一个正整数n,求下列算式的值。要求定义和调用函数fact(k)计算k的阶乘,函数返回值的类型是double

1+1/2+ .... +1/n!

 

输出保留5位小数。

Input

Output

Sample Input

5

Sample Output

sum=1.71667

HINT

Source

[Submit][Status][Forum]

HOME Back

한국어 中文 English
All Copyright Reserved 2008-2010 SDIBT TEAM
GPL2.0 2003-2010 HUSTOJ Project TEAM
Anything about the Problems, Please Contact Admin:admin