首页
题库
网课
在线模考
桌面端
登录
搜标题
搜题干
搜选项
0
/ 200字
搜索
问答题
【计算题】编写程序,输入某一时刻的时间,加一秒后输出新时间。时间以时、分、秒表示(利用结构类型)。
答案:
点击查看答案
在线练习
手机看题
你可能感兴趣的试题
填空题
下列函数用于向一非空链表插入节点(由stud指向),链表按照节点no域的升序排列。structtabinsert(structtab*head,structtab*stud){structtab*p0,*p1,*p2;p1=head;p0=stud;while((p0->no>p1->no)&&()){p2=p1;p1=p1->next;}if(p0->no<=p1->no)if(head==p1){p0->next=head;head=p0;}else{p2->next=p0;}else{p1->next=p0;}return(head);}
答案:
①p1->next!=NULL;②p0->next=p1;③p0->next=NULL
点击查看答案
手机看题
填空题
已知head指向一个单向链表,链表中每个节点包含整型数据域(data)和指针域(next)。以下函数sum求出链表中所有节点的数据域的和值,并作为函数值返回。#include
structlink{intdata;structlink*next;};voidmain(){structlink*head;ints,sum(structlink*);//省略建立链表程序s=sum(head);printf("sum=%d\n",s);}intsum(structlink*head){structlink*p;ints=0;p=head;while(){s+=;p=;}return();}
答案:
①p!=NULL;②p->data;③p->next;④s
点击查看答案
手机看题
微信扫码免费搜题