网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
等待按键按下后松开的语句是() A. while(key=0); B. if(key==0); C. while(key==0); D. if(key=0);
参考答案和解析
while(key==0)
更多 “等待按键按下后松开的语句是() A. while(key=0); B. if(key==0); C. while(key==0); D. if(key=0);” 相关考题
考题
●试题七阅读以下说明和C++代码,将解答写入答题纸的对应栏内。【说明】请编写一个函数int SeqSearch(int list[],int start,int n,int key),该函数从start开始,在大小为n的数组list中查找key值,返回最先找到的key值的位置,如果没有找到则返回-1。请修改程序中画线部分的错误并将不同情况下的输出结果补充完整。【程序】文件search.cpp的内容如下:#include iostream.hint SeqSearch(int list[],int start,int n,int key){for(int i=start;i=n;i++)// (1){if(list[i]=key) // (2){return i;}}return -1;}void main(){int A[10];int key,count=0,pos;cout" Enter a list of 10 integers: ";for(pos=0;pos10;pos++){cinA; // (3)}cout"Enter a key: ";cinkey;pos=0;while((pos=SeqSearch(A,pos,10,key))!=-1){count++;pos++;}coutkey" occurs "count(count!=1?" times":" time")" in the list."endl;}第一种情况:输入2 3 12 6 8 45 8 33 7 输入key:8输出: (4)第二种情况:输入2 3 12 6 8 45 8 33 7 输入key:9输出: (5)
考题
●试题三阅读下列函数说明和C函数,将应填入(n)处的字句写在答题纸的对应栏内。【说明】函数DelA_InsB(LinkedList La,LinkedList Lb,int key1,int key2,int len)的功能是:将线性表A中关键码为key1的结点开始的len个结点,按原顺序移至线性表B中关键码为key2的结点之前,若移动成功,则返回0;否则返回-1。线性表的存储结构为带头结点的单链表,La为表A的头指针,Lb为表B的头指针。单链表结点的类型定义为typedef struct node {int key;struct node *next;}*LinkedList;【函数】int DelA_InsB(LinkedList La,LinkdeList Lb,int key1,int key2,int len){LinkedList p,q,s,prep,pres;int k;if(!La->next||!Lb->next||len<=0)return-1;p=La->next;prep=La;while(p p- >key != key1){/*查找表A中键值为key1的结点*/prep=p;p=p->next;}if(!p)return -1;/*表A中不存在键值为key1的结点*/q=p;k=1;while(q (1) ){/*在表A中找出待删除的len个结点*/(2) ;k++;}if(!q)return -1;/*表A中不存在要被删除的len个结点*/s=Lb->next; (3) ;while(s s->key !=key2){/*查找表B中键值为key2的结点*/pres=s;s=s->next;}if(!s)return -1;/*表B中不存在键值为key2的结点*/(4) =q->next;/*将表A中的len个结点删除*/q->next= (5) ;pres->next=p;/*将len个结点移至表B*/return 0;}
考题
下列程序段实现的是顺序查找功能()intSearch(intarray[],intn,intkey){inti;array[n]=key;for(i=0;key!=array[i];i++);return(in?i:-1);}。()
此题为判断题(对,错)。
考题
阅读下列函数说明和C函数,将应填入______处的语句写在答题纸的对应栏内。[函数6说明]函数DelA_InsB(LinkedList La,LinkedList Lb,int key1,int key2,int len)的功能是:将线性表A中关键码为key1的结点开始的len个结点,按原顺序移至线性表B中关键码为key2的结点之前,若移动成功,则返回0;否则返回-1。线性表的存储结构为带头结点的单链表,La为表A的头指针,Lb为表B的头指针。单链表结点的类型定义为:typedef struct node {int key;struct node * next;} * LinkedList;[函数6]int DelA InsB(LinkedList La,LinkedList Lb,int key1,int key2,int len){ LinkedListp,q,s,prep,pres;int k;if(! La->next‖! Lb->next‖->next‖len<=0)return-1;p=La->next;prep=La;while(pp->key!=key1){ / * 查找表A中键值为key1的结点 * /prep=p;p=p->next;}if(! p)return -1; / * 表A中不存在键值为key1的结点 * /q=p;k=1;while(q (1) ){ / * 在表A中找出待删除的len个结点 * /(2);k++;}if(! q)return-1: / * 表A中不存在要被删除的len个结点 * /s=Lb->next; (3);while(s s s->key!=key2){ / * 查找表B中键值为key2的结点 * /pres=s;s=s->next;}if(! s)return-1; / * 表B中不存在键值为key2的结点 * /(4)=q->next; / * 将表A中的len个结点删除 * /q->next=(5);pres->next=p; / * 将len个结点移至表B * /return 0;}
考题
RIP路由协议是在小型互联网中常用的动态路由协议。为了保证路由器之间交换路由表的完整性,RIP协议采用报文摘要认证,常用的认证方法是MD5认证。在有认证的情况下实现两台路由器的互联,这两台路由器必须配置相同的认证方式和密钥才能进行双方路由的交换,双方必须发送版本2。阅读下面的配置信息,解释(1)~(3)处的命令。Router1(config)key chain zhangRouter1(config-keychain)key 1Router1(config-keychain-key)key-string zhangRouter1(config-keychain-key)exitRouter1(config-keychain)exitRouter1(config)interface eth0/0Router1(config-if-eth0/0)ip rip authentication key-chain zhangRouter1(config-if-eth0/0)ip rip authentication mode md5 (1)Router1(config-if-eth0/0)ip rip send version 2 (2)Router1(config-if-eth0/0)ip rip receive version 2 (3)
考题
阅读下列函数说明和C函数,将应填入(n)处的字句写在对应栏内。【说明】函数DelA_InsB(LinkedList La,LinkedList Lb,int key1,int key2,int len)的功能是:将线性表A中关键码为key1的结点开始的len个结点,按原顺序移至线性表B中关键码为key2的结点之前,若移动成功,则返回0;否则返回-1。线性表的存储结构为带头结点的单链表,La为表A的头指针,Lb为表B的头指针。单链表结点的类型定义为typedef struct node {int key;struct node * next;} *LinkedList;【函数】int DelA_InsB ( LinkedList La, LinkdeList Lb,int key1,int key2,,int len){ LinkedList p,q,s,prep,pres;int k;if( ! La->next || ! Lb-> next ||| en <=0)return-1;p = La -> next;prep = La;while(pp- >key != key1) { /*查找表A中键值为key1的结点*/prep = p;p = p -> next;}if( ! p) return - 1; /*在表A中不存在键值为key1的结点*/q=p;k=1;while(q (1))} /*表A中不存在要被删除的len个结点*/(2);k++;}if( ! q)return -1; /*表A中不存在要被删除的len个结点*/s = Lb -> next;(3);while(s s -> key != key2) { /*查找表B中键值为key2的结点*/pres =s;s =s->next;}if( ! s) return - t; /*表B中不存在键值为key2的结点*/(4)=q-> next; /*将表A中的len个结点删除*/q->next=(5);pres -> next = p; /*将len个结点移至表B */return 0;}
考题
阅读以下说明和C++代码,将解答写入对应栏内。【说明】请编写一个函数int SeqSearch(int list[],int start,int n,int key),该函数从start开始,在大小为n的数组list中查找key值,返回最先找到的key值的位置,如果没有找到则返回-1。请修改程序中画线部分的错误并将不同情况下的输出结果补充完整。【程序】文件search.cpp的内容如下:include <iostream. h >int SeqSearch( int list[ ] ,int start,int n,int key){for(int i=start;i<=n;i++) //(1){if( list[i] = key)//(2){return i;}}return -1;}void main( ){int A[10]int key,count=0,pos;cout <<" Enter a list of 10 integers:";for(pos=0;pos<10;pos++){cin >>A; //(3)}cout <<" Enter a key; ";cin >> key;pos=0;while(( pos = SeqSearch ( A, pos, 10, key)) !=-1 ){count ++;pos ++;}cout<<key<<"occurs" <<count<< (count!=1?" times":" time") <<" in the list,"<< endl;}第一种情况:输入2 3 12 6 8 45 8 33 7输入key:8输出:(4)第二种情况:输入2 3 126 8 45 8 33 7输入k6y:9输出:(5)
考题
设散列地址空间为0~m-1,key为关键字,用p去除key,将得到的余数作为key的散列地址,即h(key)=key%p。为了减少发生冲突的频率,一般取p为()。
A小于等于m的最大奇数B小于等于m的最大偶数C小于等于m的最大素数D小于等于m的最大合数
考题
阅读以下说明,然后解释(n)处标有下划线的部分含义。现有两台Cisco路由器,如图6所示,现在要求实现router1和router2连通并且要有MD5认证。有认证的情况下实现两台路由器的互联,这两台路由器必须配置相同的认证方式和密钥才能进行双方的路由的交换,双方必须发送版本2。Router1(config)key chain wanRouter1(config-keychain)key1Router1(config-keychain-key)key-string wanRouter1(config-keychain-key)exitRouter1(config-keychain)exitRouter1(config)interface eth0/0Router1(config-if-eth0/0)ip rip authentication key-chain wanRouter1(config-if-eth0/0)ip rip authentication mode md5 (1)Router1(config-if-eth0/0)ip rip send version 2 (2)Router1(config-if-eth0/0)ip rip receive version 2 (3)坚实和维护RIP显示IP数据库信息Routershow ip rip database
考题
阅读以下说明和C语言程序,将应填入(n)处的字句写在对应栏内。【说明】本程序对某电码文(原文)进行加密形成密码文,其加密算法如下:假定原文为C1,C2,C3,…,Cn加密后形成的密文为S1,S2,S3,…,Sn,首先读入正整数 key(key>1)作为加密钥匙,并将密文字符位置按顺时针方向连成一个环,如下图所示:加密时从S1位置起顺时针计数,当数到第key个字符位置时,将原文中的字符放入该密文字符位置中,同时从环中除去该字符位置;接着从环中下一个字符位置起继续计数,当再次数到第key个字符位置时,将原文中字符C2放入其中,并从环中除去该字符位置:依次类推,直至n个原文字符全部放入密文环中。由此产生的 S1S2…Sn即为原文的密文。例如,当Key=3时,原文this is a decoding system的密文为:aotgnhedi ys d imietsnc ss当Key=4时,该原文的密文为:ssdtyd htegiasiscnm e ion本程序将电码的原文存放在字符数组old中,加密钥匙存放在整数key中。函数decode用于将原文old加密并返回密文字符数组的首指针。其中函数采用一个双向循环链表CODE来表示密文环:函数strlen用于计算一个字符串中的字符个数(不包括字符串结尾符'\O')。为了简单起见,程序中假设内存容量足以满足动态存储单元分配的要求。include <stdio.h>include <stdlib.h>typedef struct node{ char ch;struct node *forward;/* Link to next node. */struct node *backward;/* Link to previous node.*/} CODE;int strlen(char *s){ int len=0;while (*s++!='\0')len++;return(len);}char *decode(char *otd,int key){ char *New; int length,count,i;CODE *loop,*p;length=strlen(old);loop=(CODE *) malloc(length*sizeof(CODE));for (i=1;i<length-1;i++){ loop[i],forward=loop[i+1];(1)}loop[0].backward=loop[length-1];loop[0],forward=loop[1];loop[length-1].forward=loop;(2)for (p=loop,i=0;i<length;i++){ for (count=1 ;count<key;count++p=p->forward;(3)p->backward->forward=p->forward;p->forward->backward=p->backward;(4)}New=(char *)malloc((length+1) *sizeef(char));for (i=0;i<length;i++)(5)New[length]='\0';return (New);}void main(){ char old[256];int key, num=0;printf("\nPlease input the telegraph: \n");while (num<255 (old[num++]=getchar())!='\n');old [(num==255)?num:num-1]='\0';do{ printf("\nPlease input Key (Key>1):");scanf("%d",key);} while (key<=1);printf( "\nThe decode of telegraph:'%s'is:\n'%s'\n",old,decode(old,key));}
考题
下列写法中等价的是( )。A.若x=1,while(x!=x)与while(x)B.若x=0,while(x!=x)与while(x)C.若x=1,while(x!=0)与while(!x)D.若x=0,while(x==0)与while(x)
考题
阅读以下说明,解释(n)处有下划线的含义。【说明】现有两台cisco路由器,现在要求实现router1和router2联通并且要有md5认证。有认证的情况下实现两台路由器的互联,这两台路由器必须配置相同的认证方式和密钥才能进行双方的路由的交换,双方必须发送版本2。router1(config)key chain wanrouter1(config-keychain)key 1router1(config-keychain-key)key-string wanrouter1(config-keychain-key)exitrouter1(config-keychain)exitrouter1(config)interfaceeth0/0router1(config-if-eth0/0)ip rip authentication key-chain wanrouter1(config-ig-eth0/0)ip rip authentication mode md5 (1)router1(config-if-eth0/0)ip rip send version 2 (2)router1(conflg-if-eth0/0)ip rip receive version 2 (3)坚实和维护rip显示ip数据库信息routershow ip rip databasenetwork nexthop metric from timerip 182.0.5.0/247 192.168.0.210 (6) 1 192.168.1.200 02:40 (7)rip? 182.0.6.0/24 192.168.0.210 1 192.168.1.200 02:40connected 192.168.0.0/24 (8)rip 193.100.98.0/24 192.168.0.236 1 192.168.0.236 02:53
考题
下图为利用ARM芯片的GPIO引脚连接按键的典型接口。当图中KEY1与KEY2键按下,其他按键均松开时,ARM芯片读到的GPF6~ GPF1的状态为:()。 下图为利用ARM芯片的GPIO引脚连接按键的典型接口。当图中KEY1与KEY2键按下,其他按键均松开时,ARM芯片读到的GPF6~ GPF1的状态为:()。A.111111B.001111C.111100D.000000
考题
窗体上仅有一个文本框Text1,当执行程序后按下键盘“a”键时打印出的结果是( )。Private Sub Text1_KeyDown(KeyCode As Integer, ShIft As Integer)key1 = KeyCode 0Print key1End SubA.True B.False C.65 D.0
考题
Routers R1 and R2, OSPF neighbors in area 0 over their Fa0/0 interfaces (respectively), currently both successfully use OSPF MD5 authentication. The OSPF configuration includes the area 0 authentication command under the router ospf 1 command.Which of the following commands must have been configur ed on R1‘s Fa0/0 interface?()A. ip ospf authentication nullB. ip ospf authentication message - digestC. ip ospf authentication -key whatever- it - isD. ip ospf message - digest - key 1 md5 whatever - it - isE. ip ospf md5 1 key whatever - it - is
考题
What is one reason that WPA encryption is preferred over WEP?()
A. A WPA key is longer and requires more special characters than the WEP key.B. The access point and the client are manually configured with different WPA key values.C. WPA key values remain the same until the client configuration is changed.D. The values of WPA keys can change dynamically while the system is used.
考题
An engineer has added the following configuration snippet to an implementation planning document. The configuration will be added to Router R1, whose Fa0/0 interface connects to a LAN to which Routers R2 and R3 also connect. R2 and R3 are already EIGRP neighbors with each of her. Assuming the snippet shows all commands on R1 related to EIGRP authentication, which answer lists an appropriate comment to be made during the implementation plan peer review?() key chain fred key 3 key - string whehew interface fa0/0 ip authenticat ion key - chain eigrp 9 fredA、The configuration is missing one authentication - related configuration commandB、The configuration is missing two authentication - related configuration commandsC、Authentication type 9 is not supported; type 5 should be u sed insteaDD、The key numbers must begin with key 1, so change the key 3 command to key 1
考题
设哈希(散列)表表长为15(哈希地址为0~14),哈希函数为H(key)=key%11,冲突处理采用线性探测Hi=(H(key)+1)%11,则将一列数15,20,26,30,35,40存储该哈希表,元素40的哈希地址为()
考题
键盘事件的执行顺序是()。A、Key Press、Key Down、Key UpB、Key Down、Key Press、Key UpC、Key Up、Key Down、Key PressD、Key Up、Key Press、Key Down
考题
假设d为一个空字典d={}。以下语句中执行后,d的内容将会变为{’key’:1}:()A、d[’key’]=1B、d.update(’key’=1)C、d.setdefault(’key’,1)D、d.update(key=1)
考题
What is one reason that WPA encryption is preferred over WEP?()A、A WPA key is longer and requires more special characters than the WEP key.B、The access point and the client are manually configured with different WPA key values.C、WPA key values remain the same until the client configuration is changed.D、The values of WPA keys can change dynamically while the system is used.
考题
单选题An engineer has added the following configuration snippet to an implementation planning document. The configuration will be added to Router R1, whose Fa0/0 interface connects to a LAN to which Routers R2 and R3 also connect. R2 and R3 are already EIGRP neighbors with each of her. Assuming the snippet shows all commands on R1 related to EIGRP authentication, which answer lists an appropriate comment to be made during the implementation plan peer review?() key chain fred key 3 key - string whehew interface fa0/0 ip authenticat ion key - chain eigrp 9 fredA
The configuration is missing one authentication - related configuration commandB
The configuration is missing two authentication - related configuration commandsC
Authentication type 9 is not supported; type 5 should be u sed insteaDD
The key numbers must begin with key 1, so change the key 3 command to key 1
考题
单选题下列关于localStorage的说法中不正确的是()A
localStoragE.getItem(key)。该接口用于获取指定key本地存储的值B
localStoragE.length。该接口表示对象中存储的键值对的数量C
localStoragE.removeItem(key)。该接口用于删除指定key本地存储的值D
localStoragE.key(index)。该接口用于将value存储到key字段。index从0开始
考题
多选题Routers R1 and R2, OSPF neighbors in area 0 over their Fa0/0 interfaces (respectively), currently both successfully use OSPF MD5 authentication. The OSPF configuration includes the area 0 authentication command under the router ospf 1 command. Which of the following commands must have been configur ed on R1's Fa0/0 interface?()Aip ospf authentication nullBip ospf authentication message - digestCip ospf authentication -key whatever- it - isDip ospf message - digest - key 1 md5 whatever - it - isEip ospf md5 1 key whatever - it - is
考题
单选题What is one reason that WPA encryption is preferred over WEP()。A
A WPA key is longer and requires more special characters than the WEP key.B
The access point and the client are manually configured with different WPA key values.C
WPA key values remain the same until the client configuration is changed.D
The values of WPA keys can change dynamically while the system is used.
热门标签
最新试卷