腾讯面的试题.docVIP

  • 3
  • 0
  • 约 14页
  • 2016-03-23 发布于山西
  • 举报
腾讯面的试题

选择题(60) c/c++ os linux 方面的基础知识 c的Sizeof函数有好几个! 程序填空(40) 1.(20) 4空x5 不使用额外空间,将 A,B两链表的元素交叉归并 2.(20) 4空x5 MFC 将树序列化 转存在数组或 链表中! 1.请定义一个宏,比较两个数a、b的大小,不能使用大于、小于、if语句 // 这样转向定义应该不算违规吧!^_^ #include “stdafx.h” #include string.h #include iostream using namespace std; #define Cmp(x,y) compare(x,y) int compare( int a, int b) { a^=(131); b^=(131); int i=31; while ((i^-1) !((a(1i))^(b(1i)))) i–; return (i^-1)?(((ai)1)?1:-1):0; } int _tmain() 只要会上网会打字足不出户日赚100元 /jz { int c; c = Cmp(5,4); coutcendl; return 0; } jruv (~~~一叶落而知天下秋~~~) 的答案: #define COMPARE(a,b) ((a)-(b)) //0: ab =0:a==b

文档评论(0)

1亿VIP精品文档

相关文档