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;
int main()
{
cin>>a>>b;
cout<<"Chu vi la:"<<fixed<<setprecision(2)<<(a+b)/2<<endl;
cout<<"Dien tich la:"<<fixed<<setprecision(2)<<a*b;
return 0;
}
a: #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<<setprecsion(2)<<cv<<endl;
cout<<"Dien tich la:"<<fixed<<setprecision(2)<<dt;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
double r,cv,dt;
int main()
{
cin>>r;
cv=2*r*pi;
dt=r*r*pi;
cout<<"Chu vi la:"<<fixed<<setprecision(2)<<cv<<endl;
cout<<"Dien tich la:"<<fixed<<setprecision(2)<<dt;
return 0;
}
Var cd,cr,cv,dt:real;
Begin
Write('Chieu dai = ');readln(cd);
Write('Chieu rong = ');readln(cr);
cv:=(cd+cr)*2;
dt:=cd*cr;
Writeln('Chu vi la ',cv:10:2);
Write('Dien tich la ',dt:10:2);
Readln
End.
#include <bits/stdc++.h>
using namespace std;
long long a,b,dt,cv;
int main()
{
cin>>a>>b;
cv=(a+b)*2;
dt=a*b;
cout<<"Chu vi la:"<<cv<<endl;
cout<<"Dien tich la:"<<dt;
return 0;
}
uses crt;
var a,b,c,p,s:real;
begin
clrscr;
repeat
write('Nhap a='); readln(a);
write('Nhap b=');c 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
begin
kt:=0;
if sqr(a)=sqr(b)+sqr(c) then kt:=1;
if sqr(b)=sqr(a)+sqr(c) then kt:=1;
if sqr(c)=sqr(a)+sqr(b) then kt:=1;
if kt=0 then writeln('Day khong la tam giac vuong')
else 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 vuong la: ',s:4:2);
end;
end
else writeln('Day khong la ba canh trong mot tam giac');
readln;
end.
#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;
}