笔果题库
计算机二级C语言程序设计
VIP题库
搜题找答案,就上笔果题库
有以下程序#include #include struct computer{ char CPU[10]; };main(){struct computer pc1, pc2;strcpy(pc1.CPU,"3.2G");strcpy(pc2.CPU,"????");pc1 = pc2;printf("%s\n",pc1.CPU);}程序运行后的输出结果是______。
搜题找答案,就上笔果题库
有以下程序#include typedef struct stu {char name[10];char gender;int score; } STU;void f(STU *a, STU *b){ *b = *a;printf("%s,%c,%d,", b->name, b->gender, b->score);}main(){ STU a={"Zhao", ''m'', 290}, b={"Qian", ''f'', 350};f(&a,&b);printf("%s,%c,%d\n", b.name, b.gender, b.score);}程序的运行结果是______。
搜题找答案,就上笔果题库
以下程序的功能是:建立一个带有头结点的单向链表,并将存储在数组中的字符依次转储到链表的各个结点中,请为下划线处有号码的选择出正确的选项。#include stuct node{ char data; struct node *next;};___(48)___ CreatList(char *s){ struct node *h,*p,*q;h=(struct node *) malloc(sizeof(struct node));p=q=h;while(*s!=''\0''){ p=(struct node *) malloc(sizeof(struct node));p->data=______;q->next=p;q=______;s++;}p->next=''\0'';return h;}main(){ char str[]="link list";struct node *head;head=CreatList(str);...}
搜题找答案,就上笔果题库
有如下程序#include struct person{char name[10];int age;};main(){struct person room[2] = {{"Wang", 19}, {"Li", 20}};printf("%s:%d\n", (room+1)->name, room->age);}程序运行后的输出结果是______。
搜题找答案,就上笔果题库
以下对结构体类型变量的定义中,不正确的是______。
搜题找答案,就上笔果题库
设有以下程序段struct person{float weight;char sex;char name[10];} rec, *ptr;ptr = &rec;从键盘读入字符串给结构体变量rec的name成员,错误的输入语句是______。
搜题找答案,就上笔果题库
有以下程序#include struct tt{int x;struct tt *y;} s[3]={1,0,2,0,3,0};main(){ struct tt *p=s+1;p->y=s;printf("%d,",p->x); p=p->y;printf("%d\n",p->x); } 程序运行后的输出结果是______。
搜题找答案,就上笔果题库
以下程序运行时,输入wang 25liu undergraduate,程序的输出结果是______。#include typedef union{ int age; char c[20];}UN;typedef struct AA{ char nm[20]; UN a;}STU;void fun1(STU *s){ printf("input name and age:\n"); scanf("%s%d",&(s->nm),&(s->a.age));}void fun2(STU *s){ printf("input name and education:\n"); scanf("%s",&(s->nm)); gets(s->a.c);}main(){ STU a[2]; int i; fun1(a); fun2(a+1); for(i=0;i
搜题找答案,就上笔果题库
以下程序的输出是______。struct st{ int x; int *y;} *p;int dt[4]={10,20,30,40};struct st aa[4]={50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0],};main(){ p=aa;printf("%d\n",++(p->x));}
搜题找答案,就上笔果题库
有以下程序#include struct S{ int a; int *b;};main(){ int x1[ ]={3,4},x2[ ]={6,7};struct S x[ ]={1,x1,2,x2};printf("%d,%d\n",*x[0].b,*x[1].b);}程序的运行结果是______。