题目内容 (请给出正确答案)
[单选题]

若有以下定义和语句: struct student { int num; char name[12]; struct { int year; int month; int day; }birth; }; struct student s; 设变量s中的“生日”是“2000年1月1日”,下列对“生日”的正确赋值方式是()。

A.year=2000;month=1;day=1;

B.birth.year=2000; birth.month=1; birth.day=1;

C.s.year=2000; s.month=1; s.day=1;

D.s.birth.year=2000; s.birth.month=1; s.birth.day=1;

提问人:网友mlsnws 发布时间:2022-01-06
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
网友答案
查看全部
  • · 有5位网友选择 A,占比41.67%
  • · 有3位网友选择 B,占比25%
  • · 有2位网友选择 C,占比16.67%
  • · 有2位网友选择 D,占比16.67%
匿名网友 选择了C
[106.***.***.161] 1天前
匿名网友 选择了C
[106.***.***.161] 1天前
匿名网友 选择了C
[106.***.***.161] 1天前
匿名网友 选择了D
[115.***.***.185] 1天前
匿名网友 选择了D
[115.***.***.185] 1天前
匿名网友 选择了D
[115.***.***.185] 1天前
匿名网友 选择了A
[38.***.***.169] 1天前
匿名网友 选择了A
[154.***.***.70] 1天前
匿名网友 选择了B
[72.***.***.99] 1天前
匿名网友 选择了C
[184.***.***.128] 1天前
匿名网友 选择了A
[220.***.***.114] 1天前
匿名网友 选择了A
[38.***.***.169] 1天前
匿名网友 选择了A
[208.***.***.100] 1天前
匿名网友 选择了B
[187.***.***.54] 1天前
匿名网友 选择了B
[31.***.***.185] 1天前
匿名网友 选择了A
[238.***.***.121] 1天前
匿名网友 选择了D
[88.***.***.209] 1天前
匿名网友 选择了A
[154.***.***.70] 1天前
匿名网友 选择了B
[72.***.***.99] 1天前
匿名网友 选择了C
[184.***.***.128] 1天前
加载更多
提交我的答案
登录提交答案,可赢取奖励机会。
更多“若有以下定义和语句: struct student { in…”相关的问题
第1题
已知有声明语句 struct student { char num[20]; char name[20]; float score; } stud; 则下列叙述中错误的是________。

A、num和name都是结构体成员名

B、struct是表示结构体类型的关键字

C、struct student是结构体类型标识符

D、stud是用户定义的结构体类型名

点击查看答案
第2题
已知学生记录描述为: struct student { int no ; char name[20]; char sex; struct { int year; int month ; int day ; } birth; } s; 设结构变量s中的“birth”应是“1985年10月1日”,则下面正确的赋值是( )。

A、year=1985; month=10; day=1;

B、birth.year=1985; birth.month=10; birth.day=1;

C、s.year=1985; s.month=10; s.day=1;

D、s.birth.year=1985; s.birth.month=10; s.birth.day=1;

点击查看答案
第3题
已有定义和声明: struct student {int no; char name[20]; struct {int year,month,day; }birth; }s; 若要求将日期"1989年11月12日"保存到变量s的birth成员中,则能实现这一功能的程序段是( ).

A、s.birth.year=1989; s.birth.month=11; s.birth.day=12;

B、s.year=1989; s.month=11; s.day=12;

C、year=1989; month=11; day=12;

D、birth.year=1989; birth.month=11; birth.day=12;

点击查看答案
第4题
以下结构体数组定义,正确的是()

A、struct date { int year; int month; int day; }date1[10],date2[10];

B、struct { int year; int month; int day; }date1[10],date2[10];

C、struct date { int year; int month; int day; }; ..... struct date date1[10],date2[10];

D、struct date date1[10],date2[10]; ..... struct date { int year; int month; int day; };

点击查看答案
第5题
如下方法,当调用stery(4)时,返回的结果是多少? public static int stery(int n){ if (n == 0) return 1; else return 3 * stery( n - 1); }
点击查看答案
第6题
有如下定义的结构体类型: struct data { int year; intmonth; int day; }workday; 对其中成员month的正确引用方式是______。

A、data.month

B、data.year.month

C、month

D、workday.month

点击查看答案
第7题
2.有如下定义: struct date { int year; int month; int day; }; struct { char name[20]; char sex; struct date birthday; }person; 下面正确的赋值语句是 。

A、year=1980

B、birthday.year=1980

C、person.birthday.year=1980

D、person.year=198

点击查看答案
第8题
编写一个DateUtil的类,里面有一个isLeapYear(int year) 的方法,判断输入年份是否是闰年。如果是闰年,返回true,其他返回false。闰年需要满足以下3个条件: 年份必须大于0,且小于等于10000。 年份不能整除100,且可以整除4。 年份可以整除100,且可以整除400。 请编写JUnit测试类DateUtilTest,采用以下用例,使用assertEquals来测试程序正确性。-100, 1000, 20000, 2020, 2019, 2000, 1900. 最后提交:DateUtil.java, DateUtilTest.java, JUnit运行截图,Maven test运行截图。
点击查看答案
第9题
有如下CDate定义: class CDate { int year=2000; int month=12; public: CDate(int year,int month){…} CDate getDate1() const { return *this;} const CDate getDate2 {return *this;} }; 试区分getDate1和getDate2方法的区别,并分别举例说明其使用。
点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信