Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
Program Hinh_Tamgiac_Program;
Uses crt;
Var a,b,c,s,p : real;
Begin
Clrscr;
Writeln(‘HINH TAM GIAC:’);
Write(‘nhap a =’);readln(a);
Write (‘nhap b =’);readln(b); Write(‘nhap c =’);readln(c);
If ((a+b)>c)and((b+c)>a)and((a+c)>b) then
Begin
p:=(a+b+c)/2;
s:=sqrt(p*(p-a)*(p-b)*(p-c)); Writeln(‘Chu vi tam giac:’,2*p:4:2) ; Writeln(‘Dien tich tam giac:’,s:4:2);
End
Else
Writeln(a,’, ‘, b,’, ‘, c, ‘ khong phai la ba canh cua tam giac’) ;
Readln;
End.
uses crt;
var a:integer;
begin
clrscr;
readln(a);
writeln(a*4);
writeln(a*a);
readln;
end.
var a,b,s:integer; c:word; begin write('nhap avà b '); read(a,b); s:=a*b*1/2; c:=(a+b)*2; writeln('dien tich la '; s ); write('chu vi la 'c); readln end
Program Dien_tich_tam_giac;
Var
a,b,c:Integer;
p,s:Real;
Begin
Writeln('DIEN TICH TAM GIAC');
Writeln('------------------');
Write('-Nhap so thu nhat: ');
Readln(a);
Write('-Nhap so thu hai : ');
Readln(b);
Write('-Nhap so thu ba : ');
Readln(c);
If (a+b>c) And (b+c>a) And (c+a>b) Then
Begin
Writeln('+Dung la Tam giac');
p:=0.5*(a+b+c);
s:=Sqrt(p*(p-a)*(p-b)*(p-c));
Writeln('+Dien tich= ',s:10:2);
End
Else
Writeln('+Khong phai la Tam giac');
Writeln;
Writeln(' Bam phim <Enter> de ket thuc');
Readln
End.
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.
uses crt;
var a:int64;
begin
clrscr;
readln(a);
writeln(a*4);
readln;
end.
uses crt;
var a,b,c:real;
begin
clrscr;
readln(a,b,c);
writeln(a+b+c:4:2);
readln;
end.