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

BUG!内详!

Posted by davydc at 2005-12-30 09:23:47 on Problem 1003
In Reply To:大家看看为什么time limit exceed?郁闷啊,搞不明白:( Posted by:OQO at 2005-12-30 02:43:40
你的源程序多输出了一些字符,要严格按照题目要求!
还有数据类型处理BUG!

> #include<iostream.h>
> void main()
> { int i=1;
>   float sumout=0,sumin;
>   cout<<"please input the lengh"<<endl;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    删除
>   cin>>sumin;
>   while(sumin!=0)
>  {
>   for(sumout=0,i=1;sumout<sumin;)
>   {sumout+=float(1/(++i));
     ~~~~~~~~~~~~~~~~~~~~~~~
     更改为sumout+=1/(float)(++i);
>    }
>   cout<<"the number of card is "<<i-1<<endl;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   更改为cout<<i-1<<" card(s)"<<endl;
>   cin>>sumin;
>  }
> }

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