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.
#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;
}
Câu 2:
#include <bits/stdc++.h>
using namespace std;
double a,b,cv,dt;
int main()
{
cin>>a>>b;
cv=(a+b)*2;
dt=a*b;
cout<<"Chu vi la:"<<fixed<<setprecision(2)<<cv<<endl;
cout<<"Dien tich la:"<<fixed<<setprecision(2)<<dt;
return 0;
}
Câu 1:
#include <bits/stdc++.h>
using namespace std;
double a,b,c;
int main()
{
cin>>a>>b>>c;
cout<<fixed<<setprecision(2)<<(a+b+c)/3;
return 0;
}
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.
Caua1:
program caumot;
begin
writeln('lop 8A chao ban!');
end.
Câu 2:
program cauhai;
int a,b,c :real;
begin
write('a='); readln(a);
write('b='); readln(b);
c= a+b;
write('Tong hai so a b la:',c);
end.
Bài 4:
#include <bits/stdc++.h>
using namespace std;
double a,b,cv,dt;
int main()
{
cin>>a>>b;
cv=(a+b)*2;
dt=a*b;
cout<<fixed<<setprecision(2)<<cv<<endl;
cout<<fixed<<setprecision(2)<<dt;
return 0;
}