歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux教程

小米公司2013校園招聘筆試題(研發)

一,填空題

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.  寫出一下程序結果

  1. #include <iostream>  
  2. #include <string>  
  3. using namespace std; 
  4.  
  5. class B 
  6.  
  7. public
  8.     B() 
  9.     { 
  10.         cout<<"B is constructing"<<endl; 
  11.         s = "B"; 
  12.     } 
  13.     void f(){ 
  14.         cout<<s; 
  15.     } 
  16. private
  17.     string s; 
  18. }; 
  19.  
  20. class D:public B{ 
  21. public
  22.     D():B(){ 
  23.         cout<<"D is constructing"<<endl; 
  24.         s = "D"; 
  25.     } 
  26.     void f(){ 
  27.         cout<<s; 
  28.     } 
  29. private
  30.     string s; 
  31. }; 
  32.  
  33. int main(){ 
  34.  
  35.     B* b = new D(); 
  36.     b->f(); 
  37.     ((D*)b)->f(); 
  38.     delete b; 
Copyright © Linux教程網 All Rights Reserved