欢迎访问本站!这是一条测试公告。
想要快速找到正确答案?
立即关注 九八五题库微信公众号,轻松解决学习难题!
作业辅导
扫码关注
论文指导
轻松解决学习难题!
中国大学MOOC计算机程序设计(实验)作业答案
计算机程序设计(实验)
学校: 九八五题库
学校: 超星学习通
题目如下:
1. 1. 当说明一个结构体变量时,系统分配给它的内存是( )
A. 结构体中第一个成员所需内存量
B. 各成员所需内存量的总和
C. 成员中占内存量最大者所需的容量
D. 结构中最后一个成员所需内存量
答案: 各成员所需内存量的总和
2. 2. 已知学生记录描述为: struct student { int no; char name[20],sex; struct { int year,month,day; }birth; }; struct student s; 设变量s中的“生日”是1984年11月12日“,对“birth”正确赋值的程序段是( )
A. s.birth.year=1984; s.birth.month=11; s.birth.day=12
B. birth.year=1984; birth.month=11 birth.day=12
C. s.year=1984; s.month=11; s.day=12;
D. year=1984; month =11; day=12;
答案: s.birth.year=1984; s.birth.month=11; s.birth.day=12
3. 3. 有以下程序段: struct st { int x; int *y;}*pt; int a[]={1,2}, b[]={3,4}; struct st c[2]={10,a,20,b}; pt=c; 以下选项中表达式的值为11的是( )
A. *pt->y
B. ++pt->x
C. pt->x
D. (pt++)->x
答案: ++pt->x
4. 4. 有以下说明和定义语句: struct student { int age; char num[8];}; struct student stu[3]={{20,"200401"},{21,"200402"},{19,"200403"}}; struct student *p=stu; 以下选项中引用结构体变量成员的表达式错误的是( )
A. (++p)->num
B. stu[3].age
C. p->num
D. (*p).num
答案: stu[3].age
5. 5. 当说明一个共用体变量时系统分配给它的内存是( )
A. 各成员所需要内存量的总和
B. 共用体中第一个成员所需内存量
C. 成员中占内存量最大者所需的容量
D. 共用体中最后一个成员所需内存量
答案: 成员中占内存量最大者所需的容量
6. 6. 以下对枚举类型名的定义中正确的是( )
A. enum a={one ,two ,three};
B. enum a {one=9 ,two=-1 ,three} ;
C. enum a={"one" ,"two" ,"three"} ;
D. enum a {"one" ,"two" ,"three"} ;
答案: enum a {one=9 ,two=-1 ,three} ;
7. 7. 设有如下枚举类型定义: enum language { Basic=3 ,Assembly ,Ada=100 ,COBOL ,Fortran} ; 枚举量Fortran 的值为( )
A. 4
B. 7
C. 102
D. 103
答案:请关注【九八五题库】微信公众号,发送题目获取正确答案。
8. 8. 以下各选项企图说明一种新的类型名,其中正确的是( )
A. typedef v1 int;
B. typedef v2=int;
C. typedefv1 int v3;
D. typedef v4: int;
答案:请关注【九八五题库】微信公众号,发送题目获取正确答案。
9. 9. 设有以下说明语句 typedef struct { int n; char ch[8]; }PER; 则下面叙述中正确的是( )
A. PER 是结构体变量名
B. PER 是结构体类型名
C. typedef struct 是结构体类型
D. struct 是结构体类型名
答案:请关注【九八五题库】微信公众号,发送题目获取正确答案。
如果觉得文章对您有用,请随意打赏。
您的支持是我们继续创作的动力!
微信扫一扫
支付宝扫一扫