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.
Tham khảo!
program Dien_tich_hinh_tam_giac;
uses crt;
var a,h : integer
S: real
begin:
clrscr;
Writeln(‘a= ‘); Readln(a);
Writeln(‘h= ‘); Readln(h);
S:= (a*h)/2
Writeln( Dien tich hinh tam giac co do dai 1 canh va chieu cao vua nhap la S= ‘,S);
Readln
end.
#include <bits/stdc++.h>
using namespace std;
double xa,ya,xb,yb,xc,yc,ab,ac,bc,am;
int main()
{
cin>>xa>>ya>>xb>>yb>>xc>>yc;
ab=sqrt(pow(xa-xb,2)+pow(ya-yb,2));
ac=sqrt(pow(xa-xc,2)+pow(ya-yc,2));
bc=sqrt(pow(xb-xc,2)+pow(yb-yc,2));
cout<<"AB="<<fixed<<setprecision(2)<<ab<<endl;
cout<<"AC="<<fixed<<setprecision(2)<<ac<<endl;
cout<<"BC="<<fixed<<setprecision(2)<<bc<<endl;
am=((2*(ac*ac+bc*bc)-ab*ab)/4);
cout<<"AM="<<fixed<<setprecision(2)<<sqrt(am)<<endl;
return 0;
}
uses crt;
var a,b,c,p,s:real;
begin
clrscr;
readln(a,b,c);
if (a>0) and (b>0) and (c>0) and (a+b>c) and (a+c>b) and (b+c>a) then
begin
p:=(a+b+c)/2;
s:=sqrt(p*(p-a)*(p-b)*(p-c));
writeln('Chu vi la: ',2*p:4:2);
writeln('Dien tich la: ',s:4:2);
end
else writeln('A B C khong phai la chieu dai ba canh cua mot tam giac');
readln;
end.
2:
#include <bits/stdc++.h>
using namespace std;
double a,b,c,p,s;
int main()
{
cin>>a>>b>>c;
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
cout<<fixed<<setprecision(2)<<s;
return 0;
}
uses crt;
var a,b,c,p,s,am,bn,cp:real;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
write('Nhap c='); readln(c);
if (a>0) and (b>0) and (c>0) and (a+b>c) and (a+c>b) and (b+c>a) then
begin
writeln('Day la ba canh trong mot tam giac vuong');
p:=(a+b+c)/2;
s:=sqrt(p*(p-a)*(p-b)*(p-c));
writeln('Dien tich tam giac la: ',s:4:2);
am:=sqrt(2*(sqr(b)+sqr(c))-sqr(a))/4;
bn:=sqrt(2*(sqr(a)+sqr(c))-sqr(b))/4;
cp:=sqrt(2*(sqr(a)+sqr(b))-sqr(c))/4;
writeln('Do dai duong trung tuyen ung voi canh a la: ',am:4:2);
writeln('Do dai duong trung tuyen ung voi canh b la: ',bn:4:2);
writeln('Do dai duong trung tuyen ung voi canh c la: ',cp:4:2);
end
else writeln('Day khong la ba canh trong mot tam giac');
readln;
end.