| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Code to it,But I think the data is too weak to make my code wrongprogram 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator