皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
下列给定,函数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; while(p!=NULL) { n++; /**********found**********/ if (p->data==ch) return ______; 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. p B. h C. *p D. n
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【判断题】当采用FedEx线上发货时,如果对时效要求不高,最好采用FedEx IP。( )
A.
正确
B.
错误
【单选题】Surprisingly perhaps , the biggest ___health risk for tourists traveling abroad is actually road traffic accidents.
A.
potential
B.
possible
C.
theoretical
【判断题】当采用FedEx线上发货时,如果对时效要求不高,最好采用FedEx。()
A.
正确
B.
错误
【单选题】大肠杆菌感受态细胞的转化,本次实验每组做几个对照实验平板?
A.
1
B.
2
C.
3
D.
4
E.
5
【简答题】列举自动识别技术在生活中有哪些应用, 其中那些属于rfid技术
【简答题】翻译4 Perhaps surprisingly, given the attention they often receive, web ads, attractive packaging and print ads appear to be far less influential factors.
【简答题】可用于 比较几个分属性质不同的观测值在各自数据分布中相对位置的高低 。
【多选题】生活中自动识别技术应用有哪些?
A.
阅读器
B.
电子标签
C.
传感器
D.
条形码
【判断题】当采用FedEx线上发货时,如果对时效要求不高,最好采用FedEx IP。( )
A.
正确
B.
错误
【判断题】平角焊焊接之前必须进行试件的打磨
A.
正确
B.
错误
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题