Problem O: 笨熊的盒子

问题及代码:

Problem O: 笨熊的盒子

Time Limit: 1 Sec   Memory Limit: 128 MB
Submit: 207   Solved: 136
[ Submit][ Status][ Web Board]

Description

现在有三个盒子,笨熊想知道这三个盒子分别能装多少蜂蜜。我们现在编一个程序,帮助笨熊解决这个问题。唉,聪明人,多受累,咱认了。
不过,笨熊有个舅舅,非要拿出下面的一段程序来,说要照这样做,否则,无条件拖欠项目开发费。小明说:“他舅舅的,不能用我的方法!”小刚说:“好舅舅,你帮我写框架我得感谢你。”
不扯了,快过年了,做出这道题,回家见咱舅舅,汇报这一学期的成就去。
#include
using namespace std;
struct Box
{
   int height;
   int width;
   int length;
};
void input(Box b[], int n);
int volume(Box b);
int main( )
{
   Box a[3];
   int i;
   input(a,3);
   for(i=0;i<3;i++)
     cout<<"volume of a["<   return 0;
}
//下面定义需要的函数,只提交下面的程序

Input

三行共9个整数,分别表示3个盒子的长宽高

Output

这三个盒子的体积

Sample Input

10 12 15
15 18 20
16 20 26

Sample Output

volume of a[0] is 1800
volume of a[1] is 5400
volume of a[2] is 8320

/*烟台大学计算机学院
作者:景怡乐
完成时间:2017年3月29日
*/
#include 
using namespace std;
struct Box
{
   int height;
   int width;
   int length;
};
void input(Box b[], int n);
int volume(Box b);
int main( )
{
   Box a[3];
   int i;
   input(a,3);
   for(i=0;i<3;i++)
     cout<<"volume of a["<>b[i].height>>b[i].width>>b[i].length;
        }
}
int volume(Box b)
{
    int c;
    c=b.height*b.width*b.length;
    return c;
}

学习心得:学会C++的简单输入和输出,其余可套用C语言。

你可能感兴趣的:(Problem O: 笨熊的盒子)