Program Hinh_chu_nhat;
Uses crt;
Var a,b,s,p: real;
Begin
clrscr;
Write('Nhap chieu dai va chieu rong: '); readln(a,b);
s:=a*b;
p:=(a+b)*2;
Writeln('Chu vi la: ',p:6:2);
Write('Dien tich la: ',s:6:2);
Readln
End.
Câu 8:
Mã:
Program Hinh_vuong;
Uses crt;
Var a,p,s: real;
Begin
clrscr;
Write('Nhap do dai canh: '); readln(a);
s:=a*a;
p:=a*4;
Write('Chu vi la ',p:6:2, ' va dien tich la ',s:6:2);
Readln
End.
Câu 9:
Mã:
Program Hinh_tron;
Uses crt;
Var r,s,p: real;
Const pi=3.14;
Begin
clrscr;
Write('Nhap ban kinh: '); readln(r);
p:=2*r*pi;
s:=r*r*pi;
Write('Chu vi la ',p:6:2,' va dien tich la ',s:6:2);
Readln
End.
Câu 10:
Mã:
Program Trung_binh_cong;
Uses crt;
Var a,b,c,d: longint;
tbc: real;
Begin
clrscr;
Write('Nhap bon so a,b,c,d: '); readln(a,b,c,d);
tbc:=(a+b+c+d)/4;
Write('Trung binh cong cua bon so do la: ',tbc:6:2);
Readln
End.