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

请教各位高手:我的程序为何WA?感激不尽!

Posted by liangyutianlyt at 2007-01-02 10:49:17 on Problem 2581
var a,b,c,d,e,i,j,r,q,z,x,a1,a2,a3,a4:longint;t:real;s:boolean;
begin
while not eof do begin
readln(t,b,c,d,e);
s:=false;
z:=100000;
a:=round(t*100);
if b>a div 25 then b:=a div 25;
if c>a div 10 then c:=a div 10;
if d>a div 5 then c:=a div 5;
if e>a then c:=a;
for i:=b downto 0 do
for j:=c downto 0 do
for r:=d downto 0 do
for q:=e downto 0 do
if i*25+j*10+r*5+q=a then begin
s:=true;
x:=i+j+q+r;
if x<z then begin
z:=x;a1:=i;a2:=j;a3:=r;a4:=q;end;
end;
if not s then writeln('NO EXACT CHANCE') else writeln(a1,' ',a2,' ',a3,' ',a4);
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