编写函数double rect-area(double length,double width=0),
题目
编写函数double rect-area(double length,double width=0),
编写函数double rect-area(double length,double width=0):当width=0时计算正方形面积,否则计算长方形面积
答案
double rect_area(double length,double width=0){
if(width==0.0) width=length;
return length*width;
}
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
最新试题
- 孔子认为学习的前提是什么?孔子建议如何对待所学的知识
- 找出答谢中书书中的议论句,并说说起作用
- 描写专心的成语
- 3时可以表示钟面上的时刻还能表示经过时间3小时吗?
- 两盒乒乓球共有61个,从甲盒中取出5个,乙盒再放入4个时,甲是乙的2倍,问甲乙两盒原来各有多少个乒乓球过程
- 已知(2sinα-cosα)/(2cosα+sinα)=1,求sin2α-3sinαcosα+4cos2α的值
- 分解因式:8(x^2-2y^2)-x(7x+y)+xy=
- 在第三周期中,各元素的原子结构呈现的变化规律是-————
- 请尽快回信,告诉我你早上做什么 英文翻译
- 一个九位数,同时能被2,3,5整除.且只能读出一个零
热门考点