歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 小米公司2013校園招聘筆試題(研發)

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

日期:2017/2/28 15:30:49   编辑:Linux教程

一,填空題

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