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.
uses crt;
var
a,b,p,s:integer;
begin
readln(a,b);
p:=(a+b)*2;
s:=a*b;
writeln('Chu vi va dien tich cua hcn lan luot la: ',p,s);
readln
end.
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
cout<<(a+b)*2<<endl;
cout<<a*b;
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;
}
uses crt;
var a,b:real;
begin
clrscr;
readln(a,b);
writeln(2*(a+b):4:2);
writeln(a*b:4:2);
readln;
end.
Program Chu_nhat; uses crt;
Var a, b, S, CV: real;
Begin
Write('Nhap chieu dai:'); readln(a);
Write('Nhap chieu rong:'); readln(b);
S := a*b;
CV := (a+b)*2;
Writeln('Dien tich hinh chu nhat la:',S:3:2);
Writeln('Chu vi hinh chu nhat la:',CV:3:2);
readln;
end.
uses crt;
var r,cd,cr,s,p: real;
begin
clrscr;
write('Nhap ban kinh: '); readln(r);
cd:=r*2*3.14;
cr:=1/3*cd;
s:=cd*cr;
p:=(cd+cr)*2;
writeln('Dien tich la: ',s);
writeln('Chu vi la: ',p);
readln;
end.
THAM KHẢO:
Program Chu_Nhat_Program;
Uses Crt;
Var a,b,s,c: real;
Begin
Clrscr;
Writeln(‘ TINH DIEN TICH & CHU VI HINH CHU NHAT:’);
Write(‘Nhap chieu dai=’); readln(a);
Write(‘Nhap chieu rong=’);readln(b);
s:=a*b;
c:=(a+b)*2;
Writeln(‘Dien tich hinh chu nhat la:’,s:6:2); Writeln(‘Chu vi hinh chu nhat:’,c:6:2); Readln;
End.
#include <bits/stdc++.h>
using namespace std;
int main()
{
double dai=25.67;
double rong=23.45;
cout<<fixed<<setprecision(2)<<dai<<endl;
cout<<fixed<<setprecision(2)<<rong;
return 0;
}