ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1070. Local Time

how can i solve this problem with this code.
Posted by Bobur 9 Mar 2008 16:12
how can i get AC

   var
   t1, t2, t3, t4 : real;
   a1, a2, a3, a4, x : integer;

begin
   readLn(t1, t2);
   read(t4, t3);
   if t1 > t2 then t2 := t2 + 24;
   if t4 > t3 then t3 := t3 + 24;
   a1 := TRUNC(t1);
   a2 := TRUNC(t2);
   a3 := TRUNC(t3);
   a4 := TRUNC(t4);
   t1 := (t1-a1)*5/3 + a1;
   t2 := (t2-a2)*5/3 + a2;
   t3 := (t3-a3)*5/3 + a3;
   t4 := (t4-a4)*5/3 + a4;
   x := TRUNC(abs(t1-t2+t3-t4)/2);
   writeLn(x);
end.