一,填空題
1. 兩個人一個速度爲a,一個速度爲b,相向而行,在距離爲s的時候,A放出鴿子,速度爲c,鴿子飛到B後,會返回A,遇到A後再返回B。在這期間鴿子飛行的路程
2. (he)的平方 = she。 h,e,s 各代表什麼
3. 運算 93 & -8
4. 將無序數組構建成最大堆,最差的時候,複雜度是
5. int *p = &n;
*p 的值是
A. p 的值 B. p的地址 C. n的值 D. n的地址
6. 一個完全二叉樹有770節點,那麼葉子個數爲
7. 有一個數組a[1...100, 1...65] 有100行 65列。
按行優先,如果數組基地址是 10000,每個元素2各存儲單元,問a[56, 22]的地址是
8. 寫出一下程序結果
#include <iostream>
#include <string>
using namespace std;
class B
{
public:
B()
{
cout<<"B is constructing"<<endl;
s = "B";
}
void f(){
cout<<s;
}
private:
string s;
};
class D:public B{
public:
D():B(){
cout<<"D is constructing"<<endl;
s = "D";
}
void f(){
cout<<s;
}
private:
string s;
};
int main(){
B* b = new D();
b->f();
((D*)b)->f();
delete b;
}