皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
6-7 计算相邻结点和的最小值。 以下程序的功能是创建有ct个结点的,ct的值从键盘输入,每个结点中包含一个整数信息(同样从键盘输入)。计算该中每两个相邻结点的整数和,求其中的最小值对应的结点序号(建成后结点序号从1到ct编号)。请补全程序,完成相应的功能。 #include #include struct node { int n; struct node *next; }; int main( ) { struct node *head=NULL, *tail=NULL, *p; int i, min, s=0, index=1, ct; scanf ( "%d", &ct ); /*从键盘输入ct的值,设ct大于1*/ for ( i=0; i n ); p->next=NULL; if ( head==NULL ) head = p; else ( (2) ) ; tail = p; } min = head->n + head->next->n; i = 1; for ( p=head->next; p!=NULL && p->next!=NULL; p=p->next ) { s = ( (3) ) ; i++; if( ( (4) ) ) { min=s; index=i; } } printf( "%d %d", index, index+1 ); } 【输入输出样例】(输入8个数,依次从尾插入)
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【多选题】小肠的生理功能有
A.
主腐熟
B.
主受盛
C.
主化物
D.
主传导
【简答题】不同的工件,穿丝孔的位置的选择不尽相同;当切割带有封闭型孔的凹模工件时,对于小的型孔切割,穿丝孔可设在 _________ ;对于大的型孔切割,穿丝孔可设在 _______ ,注意无用的切入行程不要 __________ ,否则浪费加工时间。 prefix="o" ns="urn:schemas-microsoft-com:office:office" ?xml:namespace>
【多选题】Reading Part3 Complete the conversation between a nurse and a patient. Mark the correct letter A—H on your answer sheet Nurse: Kyle, you will be on a special diet from now on. Low---salt diet. Kyle: (...
A.
I did not know that garlic salt had salt in it.
B.
I don't like low—salt diet. C . OK.I won't add salt to my food now. D.I will follow your advice. Thank you. E.Why do I need a special diet? F.I don't think my illness is serious. G.I know. What about frozen vegetables? H.Good morning. I feel much better now.
【判断题】我国水资源总量多,人均也多。()
A.
正确
B.
错误
【单选题】学校的校园网属于( )
A.
局域网
B.
城域网
C.
广域网
D.
数字交换网
【单选题】关于我国水资源的叙述,正确的是
A.
我国水资源总量不少,人均占有量也不少
B.
我国水资源的空间分布特点为:自东南向西北减少,我国耕地的分布也是南多北少,因此我国水、土资源配合良好
C.
我国水资源在季节分配上特点为:夏秋多,冬春少
D.
我国水资源最丰富的河流是长江,其次是黄河
【单选题】咱们学校的校园网属于
A.
广域网
B.
城域网
C.
局域网
【单选题】园林小品的竖向设计指的是()
A.
造型设计
B.
平面布置
C.
地面标高的确定
D.
立面设计
【判断题】股份变动及上市公告书须在交易所对上市申请文件审查同意、且所配股票上市时刊登。( )
A.
正确
B.
错误
【单选题】A heart-healthy diet is one that contains______.
A.
a low level of sodium.
B.
a lot of potassium and calcium.
C.
no salt at all.
D.
both A and B
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题