【c++基础】计算长方体的体积
来源:http://www.eviler.cnQUOTE:
#include <iostream.h>
//默认参数的用法
//计算长方体的体积
inline int Volume (int length=1,int width=1,int height=1)
{return length * width * height;}
main()
{
cout<<"the default box volume is:"
<< Volume()
<<"\n\nThe volume of a box with kenghe 10,\n"
<<"width 1 and height 1 is:"
<< Volume(10)
<<"\n\nThe volume of a box with kenghe 10,\n"
<<"width 5 and height 1 is:"
<< Volume(10,5)
<<"\n\nThe volume of a box with kenghe 10,\n"
<<"width 5 and height 2 is:"
<< Volume(10,5,2)
<<'\n';
return 0;
} 有什么用????????? 这太简单了.... 这……貌似没多大作用…………呵呵 这```````````````
看不懂.......... 难道这就是天文....
看不懂啊!
页:
[1]