主题:圆柱型
tz_xinzhe
[专家分:200] 发布于 2008-07-06 17:13:00
从键盘输入圆柱的半径和高,求出圆柱的底面积,底面周长和表面积。(提示:圆周率记作3.14,用TURBO PASCAL语言解决,十万火急!!!!!) [em18][em10][em10]
回复列表 (共4个回复)
沙发
angwuy [专家分:2280] 发布于 2008-07-06 18:05:00
套公式去吧
板凳
Mato完整版 [专家分:1270] 发布于 2008-07-06 20:33:00
{$N+}
TYPE
{Integer type declare}
I_ = INTEGER;
SI_ = SHORTINT;
LI_ = LONGINT;
BI_ = BYTE;
WI_ = WORD;
{Real type declare}
R_ = REAL;
SR_ = SINGLE;
DR_ = DOUBLE;
ER_ = EXTENDED;
CR_ = COMP;
{Other type declare}
C_ = CHAR;
B_ = BOOLEAN;
S_ = STRING;
VAR
r, h: R_;
BEGIN
READLN(r, h);
WRITELN(3.14 * r * r); {底面积}
WRITELN(3.14 * 2 * r); {底面周长}
WRITELN(3.14 * 2 * r * h); {表面积}
END.
3 楼
pascal玩家 [专家分:280] 发布于 2008-07-06 20:34:00
记得我以前写数学作业用得就是这个
program yuanzhu;
var a,b:real;
begin
read(a,b);
writeln('dimianji',a*a*3.14:10:2);
writeln('dimianzhouchang',a*2*3.14:10:2);
writeln('biaomianji',a*a*3.14*2+a*2*3.14*b:10:2);
end.
4 楼
小田甜 [专家分:3910] 发布于 2008-07-07 13:36:00
抄Mato的:
VAR
r, h: Real;
BEGIN
READLN(r, h);
WRITELN(3.14 * r * r); {底面积}
WRITELN(3.14 * 2 * r); {底面周长}
WRITELN(3.14 * 2 * r * h); {表面积}
END.
我来回复