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

给个PASCAL的AC程序

Posted by tyc3149 at 2008-07-20 10:18:40 on Problem 1003
   Program Pku_1003;
   Var sum:double;
   i,n:longint;
   c:array[1..10000] of real;
   //=====================================
   Begin
   n:=0;
   Repeat
     n:=n+1;
     Readln(c[n]);
   Until c[n]=0.0;
   For i := 1 to n -1 do
       Begin
       n := 1; sum := 0;
       While sum<c[i] do
         Begin
         n := n + 1;
         sum := sum + 1/n;
         End;
       n:=n-1;
       WriteLn(n,' card(s)');
       End;
   readln;
   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