笔果题库
计算机二级C语言程序设计
VIP题库
搜题找答案,就上笔果题库
若已建立如下图所示的单向链表结构:p    data next     ↓┌─┬─┐   ┌─┬─┐ ┌─┬─┐head →│ │ ┼→…→│E │ ┼→ │F │\0│└─┴─┘   └─┴─┘ └─┴─┘┌─┬─┐s →│G │ │└─┴─┘在该链表结构中,指针p、s 分别指向图中所示结点,则不能将s所指的结点插入到链表末尾仍构成单向链表的语句组是______。
搜题找答案,就上笔果题库
若有以下程序#include #include #include typedef struct stu{char *name, gender;int score;} STU;void f(char *p){p=(char *)malloc(10);strcpy(p, "Qian");}main(){STU a={NULL, ''m'', 290}, b;a.name=(char *)malloc(10);strcpy( a.name, "Zhao" );b = a;f(b.name);b.gender = ''f''; b.score = 350;printf("%s,%c,%d,", a.name, a.gender, a.score);printf("%s,%c,%d\n", b.name, b.gender, b.score);}则程序的输出结果是______。
搜题找答案,就上笔果题库
有以下程序#include main(){ union{ short i[2];long k;char c[4];}r,*s=&r;s->i[0]=0x39;s->i[1]=0x38;printf("%x\n",(s->c[0]));}运行后的输出结果是______。
搜题找答案,就上笔果题库
有以下程序main(){ union{ char ch[2];int d;}s;s.d=0x4321;printf("%x,%x\n",s.ch[0],s.ch[1]);}在16位编译系统上,程序执行后的输出结果是______。
搜题找答案,就上笔果题库
有如下程序#include #include struct S{char name[10];};void change(struct S *data, int value){strcpy(data->name, "****");value = 13;}main(){struct S input;int num = 4;strcpy(input.name, "THIS");change(&input, num);printf("%s,%d\n", input.name, num);}程序运行后的输出结果是______。
搜题找答案,就上笔果题库
以下程序的输出结果是______。struct HAR{ int x,y;struct HAR *p;} h[2];main(){ h[0].x=1;h[0].y=2;h[1].x=3;h[1].y=4;h[0].p=&h[1];h[1].p=h;printf("%d%d\n",(h[0].p)->x,(h[1].p)->y);}
搜题找答案,就上笔果题库
有以下程序struct S{int n; int a[20];};void f(struct S *p){ int i,j,t;for(i=0;in-1;i++)for(j=i+1;jn;j++)if(p->a[i]>p->a[j]) { t=p->a[i]; p->a[i]=p->a[j]; p->a[j]=t;}}main(){ int i; struct S s={10,{2,3,1,6,8,7,5,4,10,9}};f(&s);for(i=0;i
搜题找答案,就上笔果题库
有以下程序#include struct stu{ int num;char name[10];int age;};void fun(struct stu *p){printf("%s\n",p->name);}main(){ struct stu x[3]={{01,"Zhang",20},{02,"Wang",19},{03,"Zhao",18}};fun(x+2);}程序运行后的输出结果是______。
搜题找答案,就上笔果题库
有以下程序struct STU{ char name[10];int num;float TotalScore;};void f(struct STU *p){ struct STU s[2]={{"SunDan",20044,550},{"Penghua",20045,537}},*q=s;++p;++q;*p=*q;}main(){ struct STU s[3]={{"YangSan",20041,703},{"LiSiGuo",20042,580}};f(s);printf("%s %d %3.0f\n",s[1].name, s[1].num,s[1].TotalScore);}程序运行后的输出结果是______。
搜题找答案,就上笔果题库
以下程序拟读取一个姓氏,查找其对应的年龄并输出#include #include #include struct person { char name[10]; int age;};struct person group[6]={ "zhang", 18,"wang",20,"li",19,"zhao",18,"liu",19},*p;main(){ int I,flag=0;p=(struct person *)malloc(sizeof(struct person));gets( &p->name );for(i=0; iname,group[i].name )==0)){ printf("%d\n",group[i].age );flag=1;}if(flag==0) printf("No find!\n");}程序有语法错,出错的是______。