编写函数double rect-area(double length,double width=0),编写函数double rect-area(double length,double width=0):当width=0时计算正方形面积,否则计算长方形面积
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/12 08:16:37
![编写函数double rect-area(double length,double width=0),编写函数double rect-area(double length,double width=0):当width=0时计算正方形面积,否则计算长方形面积](/uploads/image/z/5754453-69-3.jpg?t=%E7%BC%96%E5%86%99%E5%87%BD%E6%95%B0double+rect-area%28double+length%2Cdouble+width%3D0%29%2C%E7%BC%96%E5%86%99%E5%87%BD%E6%95%B0double+rect-area%28double+length%2Cdouble+width%3D0%29%EF%BC%9A%E5%BD%93width%3D0%E6%97%B6%E8%AE%A1%E7%AE%97%E6%AD%A3%E6%96%B9%E5%BD%A2%E9%9D%A2%E7%A7%AF%2C%E5%90%A6%E5%88%99%E8%AE%A1%E7%AE%97%E9%95%BF%E6%96%B9%E5%BD%A2%E9%9D%A2%E7%A7%AF)
x){gӶO>!%4)'U(5D7(5Q*^gdhꐯYONMb?[ٴO.z9wuNXc&Dr6IE8B_fH>LӀhB%!
RKJfh!6yvp fP
编写函数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),
编写函数double rect-area(double length,double width=0):当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;
}