小米公司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; 
  • 1
  • 2
  • 下一页

相关内容