Why WA? Please, help me ! ! !
My code:
program t1070;{$N+}
var t1,t2,o1,o2 :extended;
Str :string;
i,j :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 j:=0 to 12 do
for i:=-j to j do begin
if abs(time(t1,t2,i)-time(o1,o2,-i))<0.2666667 then
if abs(time(t1,t2,i))<6.5 then begin
writeln(abs(i));
halt(0);
end;
end;
end.