K
Khách

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.

16 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

double a,b,c,p,s;

bool kt;

int main()

{

cin>>a>>b>>c;

if ((a>0) and (b>0) and (c>0) and (a+b>c) and (a+c>b) and (b+c>a))

{

kt=false;

if (a*a==b*b+c*c) kt=true;

if (b*b==a*a+c*c) kt=true;

if (c*c==a*a+b*b) kt=true;

if (kt==false) cout<<"Day khong la ba canh trong mot tam giac vuong";

else {

p=(a+b+c)/2;

s=sqrt(p*(p-a)*(p-b)*(p-c));

cout<<fixed<<setprecision(2)<<s;

}

}

else cout<<"Day khong la ba canh trong mot tam giac vuong";

}

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.

uses crt;

const fi='bai1.inp';

var f1:text;

a,b,c,cv,dt,p:real;

begin

clrscr;

assign(f1,fi); rewrite(f1);

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

cv:=a+b+c;

p:=cv/2;

dt:=sqrt(p*(p-a)*(p-b)*(p-c));

writeln(f1,'Chu vi la: ',cv:4:2);

writeln(f1,'Dien tich la: ',dt:4:2);

end

else writeln(f1,'Day khong la ba canh trong mot tam giac');

close(f1);

readln;

end.

13 tháng 2 2022

cho em hỏi cái này viết ra thuật toán thì viết kiểu sao ạ

 

#include <bits/stdc++.h>

using namespace std;

double a,b,c,p,s;

int main()

{

cin>>a>>b>>c;

if (a+b>c && b+c>a && c+b>a)

{

p=(a+b+c)/2;

s=sqrt(p*(p-a)*(p-b)*(p-c));

cout<<fixed<<setprecision(2)<<s;

}

else cout<<"Day khong la ba canh trong mot tam giac";

return 0;

}

 

28 tháng 10 2021

Kiểm tra xem tam giác đó là tâm giác đều hay không

30 tháng 10 2021

#include <bits/stdc++.h>

using namespace std;

double a,b,c;

int main()

{

cin>>a>>b>>c;

if ((a>0) and (b>0) and (c>0) and (a+b>c) and (a+c>b) and (b+c>a)) cout<<"Day la ba canh trong mot tam giac";

else cout<<"Day khong la ba canh trong mot tam giac";

return 0;

}

21 tháng 2 2023

Giúp mình ý tưởng bài đỉnh đồi pascal

 

21 tháng 2 2023

Cho mình ý tưởng bài này với!loading...  

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;

}