HDU1012 POJ1517 ZOJ1113 UVALive2083 u Calculate e【水题】
2017-11-14 05:44
495 查看
u Calculate e
Description
A simple mathematical formula for e is
e=Σ0<=i<=n1/i!
where n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.
Input
No input
Output
Output the approximations of e generated by the above formula for the values of n from 0 to 9. The beginning of your output should appear similar to that shown below.
Sample Input
Sample Output
Source
Greater New York 2000
Regionals 2000 >> North
America - Greater NY
问题链接:HDU1012 POJ1517 ZOJ1113 UVALive2083 u Calculate e
问题简述:(略)
问题分析:这是一个简单的计算问题,控制好循环并且注意格式就可以了。
程序说明:(略)
题记:(略)
AC的C语言程序如下:
Time Limit: 1000MS | Memory Limit: 10000K | |||
Total Submissions: 20144 | Accepted: 11703 | Special Judge |
A simple mathematical formula for e is
e=Σ0<=i<=n1/i!
where n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.
Input
No input
Output
Output the approximations of e generated by the above formula for the values of n from 0 to 9. The beginning of your output should appear similar to that shown below.
Sample Input
no input
Sample Output
n e - ----------- 0 1 1 2 2 2.5 3 2.666666667 4 2.708333333 ...
Source
Greater New York 2000
Regionals 2000 >> North
America - Greater NY
问题链接:HDU1012 POJ1517 ZOJ1113 UVALive2083 u Calculate e
问题简述:(略)
问题分析:这是一个简单的计算问题,控制好循环并且注意格式就可以了。
程序说明:(略)
题记:(略)
AC的C语言程序如下:
/* HDU1012 POJ1517 ZOJ1113 UVALive2083 u Calculate e */ #include <stdio.h> #define N 9 int main(void) { double e = 2.5, f=2.0; int i; printf("n e\n"); printf("- -----------\n"); printf("0 1\n"); printf("1 2\n"); printf("2 2.5\n"); for(i=3; i<=N; i++) { f *= i; e += 1.0 / f; printf("%d %.9f\n", i, e); } return 0; }
相关文章推荐
- HDU1014 POJ1597 UVALive5492 UVA408 ZOJ1314 Uniform Generator【随机函数+水题】
- HDU 1012 u Calculate e 水题
- hdu 1012:u Calculate e(数学题,水题)
- HDU1128 UVA640 UVALive5326 ZOJ1180 Self Numbers【水题】
- POJ 1511 Invitation Cards / UVA 721 Invitation Cards / SPOJ Invitation / UVAlive Invitation Cards / SCU 1132 Invitation Cards / ZOJ 2008 Invitation Cards / HDU 1535 (图论,最短路径)
- UVALive2362 POJ1004 HDU1064 ZOJ1048 Financial Management【数学计算+水题】
- UVALive2363 POJ1005 HDU1065 ZOJ1049 I Think I Need a Houseboat【数学计算+水题】
- POJ 1087 A Plug for UNIX / HDU 1526 A Plug for UNIX / ZOJ 1157 A Plug for UNIX / UVA 753 A Plug for UNIX / UVAlive 5418 A Plug for UNIX / SCU 1671 A Plug for UNIX (网络流)
- HDU 1012 u Calculate e(水题)
- UVALive5389 UVA414 POJ1493 ZOJ1339 Machined Surfaces【输入输出+水题】
- hdu 1012 u Calculate e【数学水题】
- UVALive2287 POJ1047 HDU1313 ZOJ1073 Round and Round We Go【大数+数学计算+水题】
- POJ1003 UVALive2294 HDU1056 ZOJ1045 Hangover【数学计算+水题】
- UVALive2953 POJ1775 ZOJ2358 Sum of Factorials【打表+暴力+水题】
- UVALive5520 UVA305 POJ1012 HDU1443 Joseph【数学计算+打表+水题】
- HDU1046 POJ1450 UVALive2334 ZOJ1037 Gridland【数学计算+水题】
- UVALive2536 POJ1248 HDU1015 ZOJ1403 Safecracker【密码+暴力+水题】
- HDU 1012 u Calculate e (水题)
- HDU 1012(水题)
- hdu 1012 u Calculate e