A: box->width=3;
B: cout
D: p.set(1,2);
举一反三
- 有以下定义: class Box{ int width,length,height; public: void set(int x=0,int y=0,int z=0) {width=x;length=y;height=z;} }; Box *box; 则以下哪种使用是正确的___
- 下列程序的输出结果为 class Box{ int length,width,height; public void setInfo(int l,int w,int h){ length = l; width = w; height = h; } public int volumn(){ return length*width*height; } public int area(){ return (length*width + length*height + width*height) * 2; } public String toString(){ return "Length:" + length + " width:" + width + " height:" + height + " volumn: " + volumn() + " area:" + area(); }} public class BoxTest { public static void main(String[] args) { Box b = new Box(); b.setInfo(5,2,4); System.out.println(b.toString()); }}
- 【填空题】用拷贝构造函数进行对象构造。 #include<iostream> using namespace std; class Box { public: Box(int h,int w,int len); //构造函数声明 ( 1 ) //拷贝构造函数声明 int volume(); //求立方体体积函数 private: int height; int width; int length; }; Box::Box(int h,int w,int len) { height=h; width=w; length=len; } Box::Box(Box &a) { height=a.height+5; width=a.width+5; length=a.length+5; } int Box::volume() { return(height*width*length); } void main() { Box box1(5,5,5); cout<<"The volume of box
- 在以下代码片段中,属于绝对定位的是() A: #box {width:100px;height:50px;position:absolute;} B: #box (width:100px;height:50px;position:relative;} C: #box {width:100px;height:50px;position:static;} D: #box {width:100px;height:50px;}
- 在以下代码片段中,属于绝对定位的是()。 A: box {width:100px;height:50px;} B: box {width:100px;height:50px;position:absolute;} C: box {width:100px;height:50px;position:static;} D: box (width:100px;height:50px;position:relative;}
内容
- 0
在以下代码片段中,属于绝对定位的是()。 A: box {width:100px;height:50px;} B: box {width:100px;height:50px;position:absolute;} C: box {width:100px;height:50px;position:static;} D: box (width:100px;height:50px;position:relative;}
- 1
在CSS样式表中给P标记定义边框样式可以使用的代码为: A: .box{width:250px;height:50px;border:1px red;background:pink;padding:30px;margin:20px;} B: .box{width:250px;height:50px;border:5pxdashedred;background:pink;padding:10px;margin:10px;} C: .box{width:250px;height:50px;border:15pxnonered;background:blue;padding:30px;margin:20px;} D: .box{width:250px;height:50px;border-color:red;background:yellow;padding:30px;margin:20px;}
- 2
.box{width:100px;height:100px;background:#ccc},.box元素添加()样式后显示为圆形?
- 3
1. Charges of 3.00 nC, –2.00 nC, –7.00 nC, and 1.00 nC are contained inside a rectangular box with length 1.00 m, width 2.00 m, and height 2.50 m. Outside the box are charges of 1.00 nC and 4.00 nC. What is the electric flux through the surface of the box?
- 4
运用CSS3中的border-radius属性可以将矩形边框圆角化,如果想将.box对象定义成正圆形,请填空。.box{ width: 1 ; height:500px; border:6px solid red; border-radius: 2 ; }