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.

Tham khảo!
Input : chiều dài là a, chiều rộng là b
a. Output : tính diện tích hình chữ nhật
b) Thuật toán:
- B1: Nhập a; b
- B2 : S := 0;
- B3: Tính diện tích hình chữ nhật :
S := a*b;
- B4: Thông báo và in kết quả.

#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;
}

Uses crt;
Const fi='input.txt';
Fo='output.txt';
Var f1,f2:text;
A,b:array[1..100] of integer;
I,n:integer;
Begin
Clrscr;
Assign(f1,fi); reset(f1);
Assign(f2,fo); rewrite(f2);
N:=0;
While not eof(f1) do
Begin
Inc(n);
Readln(f1,a[n],b[n]);
End;
For i:=1 to n do
Begin
Writeln('Chu vi hinh chu nhat thu ',i,' la: ',(a[i]+b[i])*2);
Writeln(f2,Chu vi hinh chu nhat thu ',i,' la: ',(a[i]+b[i])*2);
End;
Close(f1);
Close(f2);
Readln;
End.

Tham khảo!
Program …..; (tên)
uses crt;
Var a, b, p, s integer;
Begin;
Write (‘Nhap chieu dai CD’); Readln (a);
Write (‘Nhap chieu rong CR’); Readln (b);
p:= (a+b)*2
S:= a*b
Writeln (‘Chu vi hinh chu nhat:’ ,p);
Writeln (‘Dien tich hinh chu nhat:’ ,S);
Readln;
End.

uses crt;
const fi='x.inp';
var f1:text;
a,b:array[1..100]of integer;
i,n:integer;
begin
assign(f1,fi); reset(f1);
n:=0;
while not eof(f1) do
begin
n:=n+1;
readln(f1,a[n],b[n]);
end;
for i:=1 to n do
begin
writeln('Chu vi dong ',i,' la: ',(a[i]+b[i])*2);
writeln('Dien tich dong ',i,' la: ',a[i]*b[i]);
end;
close(f1);
readln;
end.

uses crt;
var a,b,cv,s:longint;
begin
clrscr;
write('a=');readln(a);
write('b=');readln(b);
cv:=(a+b)*2;
s:=a*b;
writeln('chu vi cua hinh chu nhat do la:',cv);
write('dien tich cua hinh chu nhat do la:',s);
readln;
end.
\(\dfrac{1}{2}S=\dfrac{1}{2}a.b\)
#include <bits/stdc++.h>
using namespace std;
int main()
{
float a,p,s;
cin>>a;
cin>>p;
s=a*p/2;
cout<<fixed<<setprecision(2)<<s;
return 0;
}