ZOJ 1113

水题一道- -暴力做法、打表都可以0ms AC。

时间:0毫秒。

#include<iostream>
#include<iomanip>

using namespace std;

int main()
{
    double ans=1, temp=1;
    int i=0;
   
    cout<<"n e"<<endl;
    cout<<"- -----------"<<endl;
    cout<<i<<' '<<ans<<endl;
    for(i=1; i<=9; ++i)
    {
        temp/=i;
        ans+=temp;
        if(i<3) cout<<setprecision(9);
        else    cout<<fixed<<setprecision(9);
        cout<<i<<' '<<ans<<endl;
    }
   
    return 0;
}

 

posted on 2014-08-17 20:39  且听~晓风残月  阅读(129)  评论(0)    收藏  举报

导航