Why I get WA? Pelase, help me!!!!!!!
There is my program:
program t1070;
var t1,t2,o1,o2 :extended;
Str :string;
i :integer;
procedure makeIt(var x1,x2:extended;S:string);
var y1,y2,i :integer;
sr :string;
begin
i:=0;
while s[i+1]=' ' do i:=i+1;
sr:='';sr:=sr+s[i+1];sr:=sr+s[i+2]; val(sr,y1,i);
sr:='';sr:=sr+s[i+4];sr:=sr+s[i+5]; val(sr,y2,i);
x1:=y1+y2/60;
i:=i+6;
while s[i+1]=' ' do i:=i+1;
sr:='';sr:=sr+s[i+1];sr:=sr+s[i+2]; val(sr,y1,i);
sr:='';sr:=sr+s[i+4];sr:=sr+s[i+5]; val(sr,y2,i);
x2:=y1+y2/60;
end;
Function Time(t1,t2,r:extended):extended;
var r1,r2 :extended;
begin
r1:=t1;
r2:=t2+r;
if r1>r2 then r2:=r2+24;
time:=r2-r1;
end;
begin
Readln(Str);makeIt(t1,t2,str);
Readln(Str);makeIt(o1,o2,str);
for i:=-5 to 5 do begin
if abs(time(t1,t2,i)-time(o1,o2,-i))<0.2666667 then
break;
end;
writeln(abs(i));
end.