Составить программу, вычисляющую время, прошедшее от времени t1 до t2.
program PascalGuru;
uses crt;
type
Vremia = record
cas: 0 .. 23;
min: 0 .. 59;
sec: 0 .. 59;
end;
var
t1, t2, p: Vremia;
begin
writeln('Vvedite pervoe vremia:');
write('Cas:');
readln(t1.cas);
write('Min:');
readln(t1.min);
write('Sec:');
readln(t1.sec);
clrscr;
writeln('Vvedite vtoroe vremia:');
write('Cas:');
readln(t2.cas);
write('Min:');
readln(t2.min);
write('Sec:');
readln(t2.sec);
clrscr;
writeln('Time1: ', t1.cas, ':', t1.min, ':', t1.sec);
writeln('Time2: ', t2.cas, ':', t2.min, ':', t2.sec);
if t1.cas < t2.cas then
p.cas := t2.cas - t1.cas;
if t1.min < t2.min then
p.min := t2.min - t1.min;
if t1.sec < t2.sec then
p.sec := t2.sec - t1.sec;
if t1.cas > t2.cas then
p.cas := t1.cas - t2.cas;
if t1.min > t2.min then
p.min := t1.min - t2.min;
if t1.sec > t2.sec then
p.sec := t1.sec - t2.sec;
writeln;
writeln('Raznica: ', p.cas, ':', p.min, ':', p.sec);
readln;
end.