program tam_giac;
uses crt;
var a,b,c,p,S:real;
begin
clrscr;
write('nhap canh a:'); readln(a);
write('nhap canh b:'); readln(b);
write('nhap canh c:'); readln(c);
p:=(a+b+c)/2
S:=(p*(p-a)*(p-b)*(p-c));
writeln('chu vi hinh tam giac la:',p:10:2);
writeln('dien tich hinh tam giac la:',S:10:2);
readln;
end.
Program nhu_cai_l;
User crt;
Var
a , b , c , h , S , P : Real ;
BEGIN
Writeln (' Nhap do dai 3 canh cua tam giac : ') ;
Write (' a = ') ; Readln ( a ) ;
Write (' b = ') ; Readln ( b ) ;
Write (' c = ') ; Readln ( c ) ;
Write (' h = ') ; Readln ( h ) ;
S:=1/2*a*h;
P:=a+b+c;
Writeln (' Chu vi tam giac do la:’,P) ;
Writeln (' Dien tich tam giac do la:’,S) ;
Readln
End.
Viết Công Thức Tính Cân Nặng Hai Bạn
HELP!!! MY.....CỨU TÔI VỚI.............................VỚI
a) Program TAM_GIAC;
uses crt;
var a,b,c,p,S: real;
Begin
clrscr;
Write('Nhap canh a:');readln(a);
Write('Nhap canh b:');readln(b);
Write('Nhap canh c:');readln(c);
p:=(a+b+c)/2;
S:=sqrt(p*(p-a)*(p-b)*(p-c));
Write('Dien tich tam giac la:',s:10:2);
readln
end.