CVTE笔试题答案Word格式文档下载.docx
《CVTE笔试题答案Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《CVTE笔试题答案Word格式文档下载.docx(13页珍藏版)》请在冰豆网上搜索。
28
c
29题选C
35、2
40选D
46题水的这个
可能选A
47
编程题
考虑修改下面程序
#include<
iostream>
usingnamespacestd;
typedefstructLNode
{
intdata;
structLNode*link;
}LNode,*LinkList;
//n为总人数,k为第一个开始报数的人,m为出列者喊到的数
voidJOSEPHUS(intn,intk,intm)
//p为当前节点,r为辅助节点,指向p的前驱节点,list为头节点
LinkListp,r,list,curr;
//简历循环链表
p=(LinkList)malloc(sizeof(LNode));
p->
data=1;
p->
link=p;
curr=p;
for(inti=2;
i<
=n;
i++),
{
LinkListt=(LinkList)malloc(sizeof(LNode));
t->
data=i;
link=curr->
link;
curr->
link=t;
curr=t;
}
//把当前指针移动到第一个报数的人
r=curr;
while(k--)
r=p,p=p->
while(n--)
for(ints=m-1;
s--;
r=p,p=p->
link);
r->
link=p->
printf("
%d->
"
p->
data);
free(p);
p=r->
}
#include
<
stdio.h>
stdlib.h>
int
fun(int
n)
if(n<
=2)
return
1;
else
fun(n-1)+2*fun(n-2)
;
void
main(void)
a=fun(19)+fun(13);
printf("
%d\n"
a);
177494
intmain()
intm=1;
longn,i;
n=91553;
cout<
'
\t'
n<
="
for(i=2;
i++)
while(n!
=i)
{if(n%i==0){cout<
*"
n=n/i;
elsebreak;
endl;
return0;
答案为&
rlnp
#include<
charch[7]={'
1'
'
2'
3'
4'
5'
6'
7'
};
chartemp[7];
chartmp;
for(inti=0;
7;
temp[i]=ch[i]*2+10>
115?
(ch[i]*2+10)/3:
ch[i]*2+10;
3;
for(intj=6;
j>
j--)
{
tmp=temp[i];
temp[i]=temp[j];
temp[j]=tmp;
}
cout<
temp[i];
5,12,23,
-1
答案为倒过来写