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
program hcn;
uses crt;
var d,r,dt:longint;
cv:real;
begin
write('nhap chieu dai va chieu rong cua hcn:');
readln(d,r);
cv:=(d+r)*2;
dt:=d*r;
writeln(' chu vi hcn do la:',cv);
writeln(' dien tich hcn do la:',dt);
readln
end.
uses crt;
var a,b:integer;
{-----------------chuong-trinh-con-tinh-chu-vi----------------------------------}
function cv(x,y:integer):integer;
begin
cv:=x+y;
end;
{-------------------chuong-trinh-con-tinh-dien-tich-----------------------------}
function dt(x,y:integer):integer;
begin
dt:=x*y;
end;
{-------------------------chuong-trinh-chinh-------------------------}
begin
clrscr;
write('Nhap chieu dai:'); readln(a);
write('Nhap chieu rong:'); readln(b);
writeln('Chu vi la: ',cv(a,b));
writeln('Dien tich la: ',dt(a,b));
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.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
freopen("hcn.inp","r",stdin);
freopen("hcn.out","w",stdout);
cin>>a>>b;
cout<<(a+b)*2<<endl;
cout<<a*b;
return 0;
}
uses crt;
const fi='dulieu.dat';
var f1:text;
a,b,p,s:array[1..100]of real;
i,n:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
n:=0;
while not eof(f1) do
begin
n:=n+1;
readln(a[n],b[n]);
end;
for i:=1 to n do
begin
p[i]:=(a[i]+b[i])/2;
s[i]:=a[i]*b[i];
end;
for i:=1 to n do
writeln(p[i]:4:2,' ',s[i]:4:2);
close(f1);
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;
}
Program OLM;
var a,b: integer;
s,p: longint;
begin
write('Nhap chieu dai: '); readln(a);
write('Nhap chieu rong: '); readln(b);
s:=a*b;
p:=(a+b)*2;
writeln('Chu vi hinh chu nhat la: ',p);
writeln('Dien tich hinh chu nhat la: ',s);
readln
end.