Program segiempat;
uses wincrt;
type titik=record
x:integer;
y:integer;
end;
var
a:array [1..2] of titik;
i,luas,panjang,lebar:integer;
begin
writeln('(1)********');
writeln(' ********');
writeln(' ********(2)');
writeln;
for i:= 1 to 2 do
begin
writeln('titik ',i);
write('masukan absis = ');readln(a[i].x);
write('masukan ordinat = ');readln(a[i].y);
end;
if (a[2].x>a[1].x) and (a[1].y>a[2].y) then
begin
panjang:=a[2].x-a[1].x;
lebar:=a[1].y-a[2].y;
luas:=panjang*lebar;
writeln('panjang = ',panjang);
writeln('lebar = ',lebar);
writeln('luas = ',luas);
end
else
writeln('nilai panjang/lebar bernilai minus');
end.