> 数学 >
pasacal算长方形周长和面积
写出程序.
人气:183 ℃ 时间:2020-02-03 12:58:43
解答
长方形宽:
长方形高:
//---- 函数1.定义变量
function str1(a,b){
this.a=a;
this.b=b;
this.area=a*b;
this.length=2*a+2*b;
}
//----函数2.给变量付值
function str2()
{
d=new str1(a.value,b.value);
alert("周长:"+d.length+".面积:"+d.area);
}
//-------------------
function str3(c)
{
this.c=c;
this.atan_1=Math.atan(c)
}
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版