皮皮学,免费搜题
登录
搜题
【简答题】
下列给定,函数fun的功能是:在带头结点的单向链表中,查找数据域中值为ch的结点。找到后通过函数值返回该结点在链表中所处的顺序号;若不存在值为ch的结点,函数返回0值。 #include #include #define N 8 typedef struct list { int data; struct list *next; } SLIST; SLIST *creatlist(char *); void outlist(SLIST *); int fun( SLIST *h, char ch) { SLIST *p; int n=0; p=h->next; /**********found**********/ while(p!=______) { n++; if (p->data==ch) return n; else p=p->next; } return 0; } main() { SLIST *head; int k; char ch; char a[N]={'m','p','g','a','w','x','r','d'}; head=creatlist(a); outlist(head); printf("Enter a letter:"); scanf("%c",&ch); k=fun( head,ch); if (k==0) printf("\nNot found!\n"); else printf("The sequence number is : %d\n",k); } SLIST *creatlist(char *a) { SLIST *h,*p,*q; int i; h=p=(SLIST *)malloc(sizeof(SLIST)); for(i=0; i data=a[i]; p->next=q; p=q; } p->next=0; return h; } void outlist(SLIST *h) { SLIST *p; p=h->next; if (p==NULL) printf("\nThe list is NULL!\n"); else { printf("\nHead"); do { printf("->%c",p->data); p=p->next; } while(p!=NULL); printf("->End\n"); } } A. B. NuLL C. NULL D. Null
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】当路由器接收的报文的目的 IP地址在路由表中没有匹配的表项时,采取的策略是( )
A.
转发该报文
B.
如果缺省路由存在则按照缺省路由转发,否则丢弃
C.
丢掉该报文
D.
将该报文分片
【简答题】This is the most expensive type of accommodation.
【判断题】文字狱出现并兴盛于清朝。()
A.
正确
B.
错误
【单选题】当路由器接收的报文的目的IP地址在路由表中没有匹配的表项时,采取的策略是
A.
将该报文进行广播
B.
将该报文分片
C.
将该报文组播转发
D.
如果存在缺省路由则按照路由转发,否则丢失
【单选题】19 The university accommodation officer will
A.
send a list of agents for students to contact.
B.
contact accommodation agencies for students.
C.
ensure that students have suitable accommodation.
【单选题】手术护士职责范围之外的任务是
A.
给病人摆体位,输血或输液
B.
了解病情和手术目的,提前洗手
C.
术中传递器械
D.
术中密切观察手术步骤
E.
术毕关腹前清点器械、敷料、缝针等
【单选题】Jack, ______ to be here at 8 o’clock.
A.
is sure
B.
is sure that
C.
will be sure
D.
be sure
【单选题】The accommodation jungleof China comprisedofstar rated hotels,( )andnon-standard accommodation.
A.
state-owned hotels
B.
private-owned hotels
C.
standard accommodation
D.
br and hotels
【多选题】大革命时期,北洋军阀统治着全国大部分地区,主要军阀代表人物是()。
A.
吴佩孚
B.
孙传芳
C.
张作霖
D.
阎锡山
【单选题】(2009年)在道路运输行政管理总目标中,将加强道路运输管理机构建设和( )放在了总目标顺序上的第一位。
A.
促进道路运输业健康发展
B.
维护道路运输市场良好秩序
C.
保障道路运输安全
D.
保护道路运输各方当事人的合法权益
相关题目: