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

Posted by My_loves at 2005-11-09 20:51:04 on Problem 2707
In Reply To:Why WA Posted by:My_loves at 2005-11-09 20:50:55
program p2707;
 var a,b,c,d:integer;
     out:real;

 procedure swap(var x,y:integer);
  var i:integer;
  begin
   i:=x; x:=y; y:=i;
  end;

begin
 repeat
  readln(a,b,c,d);
  if a=0 then halt;
  if b>a then swap(a,b);
  if d>c then swap(c,d);
  out:=c/a;
  if d/b<out then out:=d/b;
  if out>=1 then out:=1;
  out:=trunc(out*100);
  writeln(out:0:0,'%')
 until false;;
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