Giúp tin với mọi người ơi !

T

thien0526

program Tam_giac;
uses crt;
var a, b, c, S, P: real;
begin
clrscr;
writeln('Nhap ba so a, b, c tu ban phim:');
readln(a,b,c);
if (a+b<=c) or (a+c<=b) or (b+c<=a) then writeln('ba so da nhap khong tao thanh mot tam giac') else
begin
P:=a+b+c;
write('Chu vi cua tam giac la:', P);
P:=P/2;
S:=sqrt(P*(P-a)*(P-b)*(P-c));
write('dien tich tam giac la:', S:8:3);
end;
readln
end.
 
Last edited by a moderator:
Top Bottom