教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 实用模板 >

2016腾讯笔试真题及答案(3)

来源:网络收集 时间:2026-02-02
导读: struct node *lchild,*rchild; }node; int N2,NL,NR,N; void count(node *t) if (t-lchild!=NULL) if (t-rchild!=NULL) N2++; else NL++; else if (t-rchild!=NULL) NR++; else N++; if(t-lchild!=NULL) count(

struct node *lchild,*rchild; }node;

int N2,NL,NR,N;

void count(node *t)

if (t-lchild!=NULL)

if (t-rchild!=NULL) N2++;

else NL++;

else if (t-rchild!=NULL) NR++;

else N++;

if(t-lchild!=NULL) count(t-lchild);

if(t-rchild!=NULL) count(t-rchild);

}/* call form :if(t!=NULL) count(t);*/

三、Web前端方向简单题(略)

四、其他方向简答题(共2题,每题2分),选作题,不计入总分)

1 请设计一个排队系统,能够让每个进入队伍的用户都能看到自己在队列中所处的位置和变化,队伍可能随时有人加入和退出;当有人退出影响到用户的位置排名时需要及时反馈到用户。

2 A,B两个整数集合,设计一个算法求他们的交集,尽可能的高效。

2016腾讯笔试题

一. 单选题(每题4分,15题,共60分)

1.考虑函数原型void hello(int a,int b=7,char* pszC= * ),下面的函数调用钟,属于

不合法调用的是:

A hello(5) B.hello(5,8) C.hello(6, # ) D.hello(0,0, # )

2.下面有关重载函数的说法中正确的是:

A.重载函数必须具有不同的返回值类型 B.重载函数形参个数必须不同

C.重载函数必须有不同的形参列表 D.重载函数名可以不同

3.分析一下程序的运行结果:

#include

class CBase public:

CBase{cout《《\《

~CBase{cout《《\《

class CSub : public CBase

public:

CSub{cout《《\《

~CSub{cout《《\《

void main

CSub obj;

A. constructing CSub class B. constructing CBase class

constructing CBase class constructing CSub class

destructing CSub class destructing CBase class

destructing CBase class destructing CSub class

C. constructing CBase class

constructing CSub class

destructing CSub class

destructing CBase class

D. constructing CSub class

constructing CBase class

destructing CBase class

destructing CSub class

4.在一个cpp文件里面,定义了一个static类型的全局变量,下面一个正确的描述是:

A.只能在该cpp所在的编译模块中使用该变量

B.该变量的值是不可改变的

C.该变量不能在类的成员函数中引用

D.这种变量只能是基本类型(如int,char)不能是C++类型

2016腾讯笔试真题及答案(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/521292.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)