Program CVDT; Uses crt; Var a,b,c,d,e: real; k:byte; Begin Clrscr; Write(‘Nhap k (1-2): ‘); Readln(k); If k=1 then Begin Write(‘Nhap do dai 2 day: ‘); Readln(a,b); Write(‘Nhap do dai 2 canh ben: ‘); Readln(c,d); Write(‘Nhap chieu cao: ‘); Readln(e); Write(‘Chu vi la: ‘,a+b+c+d:5:2); Writeln; Write(‘Dien tich la: ‘,(a+b)*e/2:5:2); End Else Begin Write(‘Nhap do dai ban kinh: ‘); Readln(a); Write(‘Chu vi la: ‘,a*2*3.14:5:2); Writeln; Write(‘Dien tich la: ‘,a*a*3.14:5:2); End; Readln End.
Là 24 chia 42 từ đó tự tính vote sao đi mấy sao cũng dc
Program CVDT;
Uses crt;
Var a,b,c,d,e: real; k:byte;
Begin
Clrscr;
Write(‘Nhap k (1-2): ‘); Readln(k);
If k=1 then
Begin
Write(‘Nhap do dai 2 day: ‘); Readln(a,b);
Write(‘Nhap do dai 2 canh ben: ‘); Readln(c,d);
Write(‘Nhap chieu cao: ‘); Readln(e);
Write(‘Chu vi la: ‘,a+b+c+d:5:2);
Writeln;
Write(‘Dien tich la: ‘,(a+b)*e/2:5:2);
End
Else
Begin
Write(‘Nhap do dai ban kinh: ‘); Readln(a);
Write(‘Chu vi la: ‘,a*2*3.14:5:2);
Writeln;
Write(‘Dien tich la: ‘,a*a*3.14:5:2);
End;
Readln
End.