Câu 1:
uses crt;
var a,s,p:real;
begin
clrscr;
repeat
write('Nhap do dai canh hinh vuong:'); readln(a);
until a>0;
p:=4*a;
s:=sqr(a);
writeln('Chu vi hinh vuong la: ',p:4:2);
writeln('Dien tich hinh vuong la: ',s);
readln;
end.
Câu 2:
uses crt;
var a,b,t,s,h:real;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
t:=a+b;
h:=a-b;
s:=a*b;
writeln('Tong la: ',t:4:2);
writeln('Hieu la: ',h:4:2);
writeln('Tich la: ',s:4:2);
readln;
end.
Câu 3:
uses crt;
var a,b,c:real;
begin
clrscr;
repeat
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
write('Nhap c='); readln(c);
until (a>0) and (b>0) and (c>0);
if (a+b>c) and (a+c>b) and (b+c>a) then writeln('Day la ba canh trong mot tam giac')
else writeln('Day khong la ba canh trong mot tam giac');
readln;
end.