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

Code to it,But I think the data is too weak to make my code wrong

Posted by vxk at 2003-11-13 19:31:11 on Problem 1003
program hangover;
var
sum,c:extended;
m,n:integer;
begin
m:=1;
while m<>0 do
begin
c:=0;
readln(c);
if c=0.00 then exit;
sum:=0;
n:=0;
Repeat
 sum:=sum+1.0/(n+2);
 n:=n+1;
Until sum>=c;
writeln(n,' card(s)');    {It Would Be Wrong In My Mind,But It Run Correctly.}
end;
end.

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