正在加载图片...
double rectanglearea (double a, double b); (续) void maino double length width cout<<"Please input the length and width of the rectangle: cin>>length>>width; cout<<"the area of the rectangle is"<<rectanglearea(length, width); cout<<endl; double rectanglearea(double a, double b) double s: s=a*b return s 说明:由两个函数组成,函数main接受用户的输入后,用输入值作 为实参调用函数 rectanglearea,子函数 rectanglearea计算出长方形的 面积,并将其值返回给函数mi,由函数mi显示出来double rectanglearea(double a,double b); void main() { double length,width; cout<< ″Please input the length and width of the rectangle:″; cin>>length>>width; cout<< ″the area of the rectangle is ″<<rectanglearea(length,width); cout<<endl; } double rectanglearea(double a,double b) { double s; s=a*b; return s; } 说明:由两个函数组成,函数main接受用户的输入后,用输入值作 为实参调用函数rectanglearea,子函数rectanglearea计算出长方形的 面积,并将其值返回给函数main,由函数main显示出来。 (续)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有