Bài 1:
program cvdt;
uses crt;
var a,b,cv,dt:integer;
begin
clrscr;
writeln('Hay nhap hai canh hinh chu nhat');readln(a,b);
cv:=(a+b)*2;
dt:=a*b;
writeln('Chu vi hinh chu nhat la ',cv);
writeln('Dien tich hinh chu nhat la ',t);
eadln;
end;
Bài 2:
program cvdt;
uses crt;
var a,dt:integer;
begin
clrscr;
writeln('Hai nhap canh hinh vuong')readln;
dt:=a*a;
writeln('Dien tich hinh vuong la ',dt);
readln;
end.
Chúc bạn học tốt!!!!!
program bai1;
var a,b,cv,dt:real;
begin
write('a= ');readln(a);
write('b= ');readln(b);
cv:=(a+b)*2;
dt:=a*b;
writeln('CHu v la ',cv);
writeln('Dien tich la ',dt);
readln
end.
bài 1
var a,b,cv,dt:integer;
begin
write('a=');readln(a);
write('b=');readln(b);
cv:=(a+b)*2;
dt:=a*b;
writeln(' Chu vi hinhf chu nhat la: ',cv);
writeln(' Dien tich hinh chu nhat la: ',dt);
readln;
end.
Bài 2
chỉ 1 cạnh thui nha
var a,dt,cv:integer;
begin
write('a=');readln(a);
cv:=a*4;
dt:=a*a;
writeln(' Chu vi hinh vuong la: ',cv);
writeln(' Dien tich hinh vuong la: ',dt);
readln;
end.