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

谁知道我这个哪里错了。。

Posted by GSMU at 2011-05-24 17:05:03 on Problem 1003
#include<stdio.h>
#include <stdlib.h>
int main()
{
    float sum=0;
    float x;
    int i;
    while(scanf("%f",&x)&&x!=0.0)
    {
        sum=0;
        for(i=2;;i++)
        {
            sum+=1.0/i;
            if(sum>x)
            {
                printf("%d caed(s)\n",i-1);
                break;
            }

        }
    }
    //system("pause");
    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