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

有以下程序:#include<stdlib.h>struct NODE{ int num;stmct NODE *next;};main(){ struct NODE * p, * q,* r;p=(struct NODE * )malloc(sizeof(struct NODE) );q=(struct NODE * )malloc(sizeof(struct NODE) );r=(struct NODE * )malloc(sizeof(struct NODE) );p->num=10; q->num=20; r->num=30;p->next=q; q->next=r;printf("%d\n",p->num+q->next->num);}程序运行后的输出结果是

A.10

B.20

C.30

D.40

提问人:网友liuqlgxk 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
网友答案
查看全部
  • · 有4位网友选择 B,占比21.05%
  • · 有4位网友选择 D,占比21.05%
  • · 有3位网友选择 A,占比15.79%
  • · 有2位网友选择 C,占比10.53%
  • · 有2位网友选择 D,占比10.53%
  • · 有2位网友选择 C,占比10.53%
  • · 有1位网友选择 A,占比5.26%
  • · 有1位网友选择 B,占比5.26%
匿名网友 选择了A
[92.***.***.85] 1天前
匿名网友 选择了D
[241.***.***.45] 1天前
匿名网友 选择了B
[103.***.***.91] 1天前
匿名网友 选择了C
[77.***.***.244] 1天前
匿名网友 选择了A
[31.***.***.172] 1天前
匿名网友 选择了A
[187.***.***.176] 1天前
匿名网友 选择了D
[73.***.***.253] 1天前
匿名网友 选择了C
[206.***.***.130] 1天前
匿名网友 选择了D
[218.***.***.83] 1天前
匿名网友 选择了A
[92.***.***.85] 1天前
匿名网友 选择了D
[238.***.***.132] 1天前
匿名网友 选择了D
[241.***.***.45] 1天前
匿名网友 选择了B
[103.***.***.91] 1天前
匿名网友 选择了C
[77.***.***.244] 1天前
匿名网友 选择了A
[31.***.***.172] 1天前
匿名网友 选择了A
[187.***.***.176] 1天前
匿名网友 选择了D
[73.***.***.253] 1天前
匿名网友 选择了C
[206.***.***.130] 1天前
匿名网友 选择了D
[218.***.***.83] 1天前
匿名网友 选择了D
[238.***.***.132] 1天前
加载更多
提交我的答案
登录提交答案,可赢取奖励机会。
更多“有以下程序: #include<stdlib.h> stru…”相关的问题
第1题
若有以下说明语句: struct date { int year; int month; int day; }brithday; 则下面的叙述不正确的是

A、struct是声明结构体类型时用的关键字

B、struct date 是用户定义的结构体类型名

C、brithday是用户定义的结构体类型名

D、year,day 都是结构体成员名

点击查看答案
第2题
以下程序的运行结果是什么? #include <stdio.h> void hello_world(void) { printf("hello,world!\n"); } void three_hellos(void) { int counter; for(counter=1;counter<=3;counter++) hello_world(); } int main() { three_hellos();>
点击查看答案
第3题
以下程序的运行结果是( )。 #include <stio.h> int main() { int i,a[5]; for(i=0;i<=4;i++) a[i]="i+1;" for(i="4;i">=0;i--) printf("%d ", a[i]); printf("\n"); return 0; }

A、0 1 2 3 4 5

B、5 4 3 2 1

C、4 3 2 1 0

D、编译错误,程序无法运行

点击查看答案
第4题
include <stdio.h>

struct date

{int year=2010;

int month=1;

int day=1;

}datel;

main()

{struct date date2;

date2.year=2010;

date2.month=8:

date2.day=5;

printf("日期1:%d-%d-%d\n",date1.year,date1.month,date1.day);

printf("日期2:%d-%d-%d\n",date2.year,date2.month,date2.day);

}

错误:______

改正:______

点击查看答案
第5题
已知职工记录描述为:  struct date { int  day;  int  month;  int  year; }; struct  workers { int no;  char name[20];  char sex; struct date birth;  };  struct workers  w;  设变量w中的“生日”应为“1993年10月25日”,则下列对“生日”的正确赋值方式是 ()。

A、day=25; month=10; year=1993;

B、w.day=25; w.month=10; w.year=1993;

C、w.birth.day=25; w.birth.month=10; w.birth.year=1993;

D、birth.day=25; birth.month=10; birth.year=1993;

点击查看答案
第6题

看代码,写出运行结果 # include # include struct AGE { int year; int month; int day; }; struct STUDENT { char name[20]; //姓名 int num; //学号 struct AGE birthday; //生日 float score; //分数 }; int main(void) { struct STUDENT student1; struct STUDENT *p = NULL; p = &student1; strcpy((*p).name, "小明"); (*p).birthday.year = 1989; (*p).birthday.month = 3; (*p).birthday.day = 29; (*p).num = 1207041; (*p).score = 100; printf("name : %s\n", (*p).name); printf("birthday : %d-%d-%d\n", (*p).birthday.year, (*p).birthday.month, (*p).birthday.day); printf("num : %d\n", (*p).num); printf("score : %.1f\n", (*p).score); return 0; }

点击查看答案
第7题
下列程序的运行结果为()。

#include

main

{ struct date

{int year,month,day;

}today;

printf("%d\n",sizeof(struct date));

}

A.8

B.6

C.10

D.12

点击查看答案
第8题
有以下程序: class Date { public: Date(int y,int m,int d); { year = y; month = m; day = d; } Date(int y = 2000) { year = y; month = 10; day = 1; } Date(Date &d) { year = d.year; month = d.month; day = d.day; } void print() { cout<<year<<"."<<month<<"."<<day<<endl; } private: int year,month,day; }; Date fun(Date d) { Date temp; temp = d; resurn temp; } int main () { Date date1 (2000,1,1),date2 (0,0,0); Date date3 (date1); date2 = fun(date3); return 0; } 程序执行时,Date类的拷贝构造函数被调用的次数是

A.2

B.3

C.4

D.5

点击查看答案
第9题

class MyException extends Exception{ private int detail; MyException( int a ){ detail = a;} public String toString( ){ return "MyException "+detail; } } public class ExceptionDemo{ public static void compute(int a) throws MyException { System.out.println("called compute("+a+")"); if( a<0 ) throw new myexception(a); system.out.println("normal exit"); } public static void main( string args[] ){ try{ compute(0 ); compute(-3 catch( myexception e system.out.println("caught "+e); 执行结果: ___________________>

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

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

简答题官方微信公众号

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

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

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