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.
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
uses crt;
var a,b:real;
begin
clrscr;
write('Nhap do dai canh thu nhat:'); readln(a);
write('Nhap do dai canh thu hai:'); readln(b);
writeln(sqrt(sqr(a)+sqr(b)):4:2);
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.
var a,b,c,s,p: real;
begin
write('Nhap canh thu nhat: '); readln(a);
write('Nhap canh thu hai: '); readln(b);
write('Nhap canh thu ba: '); readln(c);
if (a+b>c) and (b+c>a) and (c+a>b) then
begin
p:=(a+b+c)/2;
s:=sqrt(p*(p-a)*(p-b)*(p-c));
writeln('Chu vi tam giac la ',2*p:5:2, '(dvdd)');
writeln('Dien tich tam giac la: ',s:5:2, '(dvdt)');
if (a=b) and (b=c) then writeln('Day con la tam giac deu') else
if (a=b) or (b=c) or (c=a) then writeln('Day la tam giac can') else
if (a*a+b*b=c*c) or (b*b+c*c=a*a) or (c*c+a*a=b*b) then writeln('Day la tam giac vuong') else
writeln('Day la tam giac thuong');
if ((a=b) or (b=c) or (c=a)) and ((a*a+b*b=c*c) or (b*b+c*c=a*a) or (c*c+a*a=b*b)) then writeln('Day la tam giac vuong can')
end
else writeln(a:5:2,',',b:5:2,',',c:5:2,' khong la do dai mot tam giac');
end.
#include <bits/stdc++.h>
using namespace std;
double a,b,c,h,p,s;
int main()
{
cin>>a>>b>>c;
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
if (s>50) cout<<"Dien tich tam giac lon hon";
else cout<<"Dien tich tam giac nho hon";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
double a,b,c,s,p;
int main()
{
//freopen("DTTAMGIAC.inp","r",stdin);
//freopen("DTTAMGIAC.out","w",stdout);
cin>>a>>b>>c;
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
cout<<fixed<<setprecision(5)<<p*2<<endl;
cout<<fixed<<setprecision(5)<<s;
return 0;
}
Program dung;
uses crt;
var s,a,b: real;
begin
clrscr;
write('Nhap a; b : '); readln(a,b);
s:=(a*b)/2;
writeln('Dien tich tam giac vuong la: ',s:1:2);
readln;
end.