Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

bu zhi dao zen me cuo le

Posted by moxiaobei at 2011-05-08 20:59:01 on Problem 1517
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

int main()
{
    float t;
    double sum;
    sum=2;
    t=1;
    printf("n e\n");
    printf("- -----------\n");
    for(int i=0;i<=9;i++)
    {


        if(i==0)printf("0 1\n");
        else if(i==1)printf("%d %.0lf\n",i,sum);
        else
        {
            t=t*i;
            sum=sum+1.0/t;
            if(i==2)printf("%d %.1lf\n",i,sum);
            else printf("%d %.9lf\n",i,sum);
        }
    }
    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator