Program Chu_nhat; uses crt;
Var a, b, S, CV: real;
Begin
Write('Nhap chieu dai:'); readln(a);
Write('Nhap chieu rong:'); readln(b);
S := a*b;
CV := (a+b)*2;
Writeln('Dien tich hinh chu nhat la:',S:3:2);
Writeln('Chu vi hinh chu nhat la:',CV:3:2);
readln;
end.
Program chunhat;
uses crt;
var a,b,p,s:real;
begin
clrscr;
writeln('Nhap chieu dai va rong cua hinh chu nhat: ');
readln(a,b);
s:=a*b;
p:=(a+b)*2;
write('Chu vi hinh chu nhat la: ', p:1:2);
writeln;
write('Dien tich hinh chu nhat la: ', s:1:2);
readln;
end.
Kết quả: