问题 填空题

[说明]
下面的程序是通过双链结构来查找学生的信息程序的一部分,即创建双向链表部分。
[函数]
#include <stdio.h>
#define N 10
typedef struct node

char name [20];
struct node *llink,*rlink;
stud; /*双链表的结构定义*/
/*双链表的创建*/
stud * creat (int n)

stud *p,*h,*s;
int i;
if ((h= (stud *) malloc (sizeof (stud))) ==NULL)

printf ("cannot find space! \n") ;
exit (0) ;

h->name[0]=’\0’;
h->llink=NULL;
h->rlink=NULL;
p=h;
for(i=0; i<n; i++)

if((s= (stud *) malloc (sizeof (stud)))==NULL)

printf ("cannot find space! \n") ;
exit (0) ;

(1) ;
printf("Please input the %d man’s name: ";i+1) ;
scanf("%s", s->name) ;
(2) ;
(3) ;
p=s ;

(4) ;
(5) ;
return (h) ;

答案

参考答案:s->llink=p

填空题
填空题

如下图所示,一台Cisco 3500系列交换机上连接2台计算机,他们分别划分在VLAN10(ID号为10)和VLAN11(ID号为11)中。交换机千兆以太网端口(g0/1)连接一台路由器,使2个VLAN之间能够通信,交换机管理地址为167.11.45.2/24,缺省路由地址为167.11.45.1/24。请阅读以下交换机的配置信息,并补充空白处的配置命令或参数。按题目要求完成交换机的配置。(注:填写答案时,配置语句的关键字要求拼写完整)

Switch-3548>enable

Password:** * * * * * * * *

Switch-3548#

Switch-3548#configure terminal

Switch-3548(config)#hostname Switch-lib

Switch-lib(config)#

Switch-lib(config)#interface vlan 1

Switch-lib(config-if)#no shutdown

Switch-lib(config-if)#ip address (1)配置交换机的管理地址

Switch-lib(config-if)#exit

Switch-lib(config)#ip default-gateway 167.11.45.1

Switch-lib(config)#vtp domain lib

Switch-lib(config)#vtp mode transparent

Switch-lib(config)#exit

Switch-lib#vlan data

Switch-lib(vlan)#vlan (2)立VLAN10

…… 建立VLAN11(省略)

Switch-lib(vlan)#exit

Switch-lib#configure terminal

Switch-lib(config)#interface f0/1

Switch-lib(coniig-if)#no shutdown

Switch-lib(config-if)#switchport(3)为端口f0/1分配VLAN

Switch-lib(config-if)#exit

Switch-lib(config)#interface t0/6

…… 为端口f0/6分配VLAN(省略]

Switch-lib(config-if)#exit

Switch-lib(config)#interface g0/1

Switch-lib(config-if)#switchport (4)设置VLAN trunk模式

Switch-lib(config-if)#switchpoa trunk encapsulation dot1q

Switch-lib(config-if)#switchport trunk (5)置允许中继的VLAN

Switch-lib(config-if)#exit

Switch-lib(config)#exit

Switch-lib#

(1)处填()