第 ii 页
中兴笔试题目
公共局部〔50分〕
1:作业调度程序从处于〔B〕状态的队列中选择适当的作业的作业投入运行。〔3分〕
A 运行 B 提交 C 完成 D后备
2:SQL语言中,删除一个表的命令是〔B〕〔3分〕
har * &pr = p;〔3分〕
3:“零值〞可以是0,,FALSE或者“空指针〞。例如int变量n及“零值〞比拟的if语句为:if〔n==0〕,那么BOOL flag及“零值〞比拟的if语句为 if(!a) ;float x及“零值〞比拟的if语句为:const float EPSINON = ; if ((x >= - EPSINON) && (x <= EPSINON)。〔6分〕
4:设有如下语句:〔3分〕
Int x;
(C)
*px=0;
那么选择以下哪条语句可将x值置为0。
A int *px; B int const *px=&x;
第 v 页
C int *const px=&x; D const int *px=&x;
5:设void f1〔int *m,long &n〕;int a;long b;那么以下调用合法的是〔B〕〔3分〕
A f1〔a,b〕 B f1〔&a,b〕
C f1〔a,&b〕 D f1〔&a,&b〕
6:请写出如下代码的运行结果〔6分〕6
Int main()
{int a,b,c,d;
a=0;
b=1;
c=2;
d=3;
printf(“%d〞,a+++b+c+++d++);
7:写出下面函数的功能〔12分〕将数组a中的元素(如果为类类型,调用拷贝赋值算符)逆序放置到数组b中
Template<class Type>
void WE(Type a[],Type b[],int n){
for(int i=0;i<n;i++) b[n-i-1]=a[i];}
8写一段代码判断一个单向链表中是否有环。〔14分〕
给出如下构造
Struct node
第 vi 页
{steuct *next;
Typedef stuct node Node;
答:
#include <>
struct listtype
int data;
struct listtype * next;
typedef struct listtype * list;
/* Check that whether there is loop in the singly linked list sll or not. */
int find_circle(list sll)
list fast = sll;
list slow = sll;
if (NULL == fast)
return -1;
while (fast && fast->next)
fast = fast->next->next;
slow = slow->next;
if (fast == slow)
return 1;
return 0;
JAVA局部〔50分〕
第 viii 页
1:判断以下对的是哪个〔B〕〔3分〕
A short s1=1;s1=s1+1
B short s1=1;s1+=1
C short s1=1;s1=s1-1
D short s1=1;s1=s1*1
2:main方法是Java Application程序执行的入口点,关于main方法的方法头以下哪项是合法的〔C〕〔3分〕
A public static void main 〔〕
B public static void main 〔String args〕
C public static int main 〔String []arg〕
D public void main 〔String args〕
3:设float x=1,y=2,z=3,那么表达式y+=z--/++x的值是〔A〕〔3分〕
A B 3
C 4 D 5
4:〔〕=12
〔-〕=-11(4分)
5:假设x=10,y=20,z=30;计算以下表达式的值〔6分〕
A x<10||x>10_________false
各大it公司面试题 来自淘豆网m.daumloan.com转载请标明出处.