首页 > 资料专栏 > HRM > 人力资源 > 面试甄选 > 互联网技术岗之gamesloftC++面试题目DOC

互联网技术岗之gamesloftC++面试题目DOC

中家
V 实名认证
内容提供者
资料大小:48KB(压缩后)
文档格式:DOC
资料语言:中文版/英文版/日文版
解压密码:m448
更新时间:2022/7/31(发布于广东)
阅读:6
类型:积分资料
积分:10分 (VIP无积分限制)
推荐:升级会员

   点此下载 ==>> 点击下载文档


文本描述
哪些操作会隐式调用C++的拷贝构造函数? 貌似答案是B和C,是一道选择题,
2.数据结构定义:通道和墙组成的迷宫 这个可以写一个矩阵了,比如 ? a[x][y] 然后用0表示墙,1表示可以通过 3.一个16×16像素的date画在一个坐标为x,y的屏幕上,屏幕的像素是Wscreen和Hscreen,函数改错.
4.单链表结构定义:节点存储一个整型数,给代码。合并二个已经按照该整型数从小到大排好序的链表,合并后链表也是同样排序好的。 typedef ? struct ? p { int ? date; struct ? p ? *next; }node; Node* ? uniteList(Node* ? first,Node*second) { Node*head=NULL; Node*cur=NULL; Node*temp=NULL; while ? (first&&second) { if ? (first-> key <second-> key) { temp=first; first=first-> next; } else { temp=second; second=second-> next; }
if ? (head==NULL) { cur=temp; head=cur; } else { cur-> next=temp; cur=temp }
} if ? (first==NULL) { temp=second; } else temp=first; while ? (temp) { cur-> next=temp; temp=temp-> next; } cur-> next=NULL; return ? head; } 5.设计一个函数,找出水仙花数,水仙花数的定义153=1^3+5^3+3^3 貌似要写一个可扩展的水仙花数的程序了…
int?i = n; int?j = 0; while (i != 0) { int a = (i%10); j = j + (a*a*a); i = i/10; } 6.设计一个函数,找出一个32位的整形二进制数中的1的个数,尽量不要使用逐位比较.
int?getBitCount(int?n) { int?count?=?0; while?(n?!=?0)?{ count+=(n?&?1); n >>=1; } return?count; }
7.回文,用递归的查找回文了,填程序.
8.写出一个函数用来判断一个点到一个平面的关系。用一个点和法向量来表示平面。输入一个点和一个面,返回该点在面的前面,后面,还是在这个面上。 bool ? loc(Point ? pt,Plain ? pn) { bool ? res ? = ? static_cast <bool> (pn.getl*(po.getx-pn.