huicpc0838

hdu1012 u Calculate e

#include<stdio.h>
int main(){
    
int i, fac=6;
    
double ans=2.5;
    puts(
"n e");
    puts(
"- -----------");
    puts(
"0 1");
    puts(
"1 2");
    puts(
"2 2.5");
    
for(i=4; i<=10; i++){
        printf(
"%d %.9lf\n", i-1, ans+=1.0/fac);//开始搞到8位,wa了 
        fac *= i;
    }

    system(
"pause");
    
return 0;
}

         

posted on 2010-07-13 11:46 huicpc0838 阅读(24) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航:   博客园   博客园最新博文   博问   管理


导航

<2026年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

统计

常用链接

留言簿

文章档案

搜索

最新评论