Time Limit: 2000/1000 MS
(Java/Others) Memory Limit: 65536/32768 K
(Java/Others)
Total Submission(s): 28686 Accepted
Submission(s): 12762
1 #include <stdio.h>
2 int main()
3 {
4 int i;
5 printf("n e\n");
6 printf("- -----------\n");
7 printf("0 1\n"); //没有统一格式,提前输出。
8 printf("1 2\n");
9 printf("2 2.5\n");
10 double ans = 1;
11 double t = 1;
12 for(i=1;i<=9;i++){
13 t = 1.0/i*t; //迭代计算
14 ans += t;
15 if(i<3) continue;
16 printf("%d %.9lf\n",i,ans);
17 }
18 return 0;
19 }
hdu 1012:u Calculate e(数学题,水题),布布扣,bubuko.com
hdu 1012:u Calculate e(数学题,水题)
原文:http://www.cnblogs.com/yym2013/p/3695088.html