[单选题]

有以下程序 include struct NODE { int num;struct NODE*next;}; main() { struct NO

有以下程序

#include<stdlib.h>

struct NODE

{ int num;struct 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

参考答案与解析:

相关试题

有以下程序 #include struct NODE{ int num; st

[单选题]有以下程序 include struct NODE{ int num; struct NODE *next;}; main( )有以下程序#include <stdlib.h>struct NODE{int num;struct NODE *next;};main( ){ struct NODE *p,*q,*r;int sum=0;p=(struct NODE *)malloc(sizeof(struct NODE));q=(struct NODE *)malloc(sizeof(struc

  • 查看答案
  • 有以下程序: #include struct NODE {int num;stm

    [单选题]有以下程序: include struct NODE {int num;stmct NODE *next;}; main( ) { str有以下程序:#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(stru

  • 查看答案
  • 有以下程序 #include struct NODE {int num;stmc

    [单选题]有以下程序 include struct NODE {int num;stmct NODE*next;}; main() { struct NODE有以下程序#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)

  • 查看答案
  • 有以下程序: #include struct NODE{ int num; st

    [单选题]有以下程序: include struct NODE{ int num; struct NODE*next; } main() {structNOD有以下程序:#include<stdlib.h>struct NODE{int num;struct NODE *next;}main(){ struct NODE *p,*q,*r;int sum=0;p=(struct NODE *)malloc(sizeof(struct NODE));q=(Struct NODE *)malloc(sizeo

  • 查看答案
  • 有以下程序: #include struct NODE { int num; s

    [单选题]有以下程序: include struct NODE { int num; struct NODE*next; }; main() { struct有以下程序:#include <stdlib.h>struct NODE{ int num; struct NODE *next; };main(){ struct NODE *p,*q,*r;p=(struct NODE*)malloc(sizeof(struct NODE));q=(struct NODE*)mallloc(sizeof(stru

  • 查看答案
  • 有以下程序段typedef struct NODE{int num;struct

    [单选题]有以下程序段 typedef struct NODE {int num; struct NODE *next; }OLD; 以下叙述中正确的是A.以上的说朗形式非法B.NODE是一个结构体类型C.OLD是一个结构体类型D.OLD是一个结构体变量

  • 查看答案
  • 有以下程序 #inGlude struct NODE { int num; st

    [单选题]有以下程序 inGlude struct NODE { int num; struct NODE *next; } main() {struct N有以下程序#inGlude<stdlib.h>struct NODE {int num;struct NODE *next;}main(){ struct NODE *p,*q,*r;int sum=0;p=(struct NODE*)malloc(sizeof(struct NODE));q=(struct NODE*)malloc(sizeof(

  • 查看答案
  • 有以下程序段: typedef struct NODE {int num; st

    [单选题]有以下程序段: typedef struct NODE {int num; struct NODE *next; }OLD; 以下叙述中正确的是 ______。A.以上的说明形式非法B.NODE是一个结构体类型C.OLD是一一个结构体类型D.OLD是一个结构体变量

  • 查看答案
  • 有以下程序段 typedef struct node{ int data;str

    [单选题]有以下程序段 typedef struct node{ int data;struct node *next;}*NODE; NODE p; 以下叙述中正确的是A.p是指向struct node结构变量的指针的指针B.NODE p;语句出错C.p是指向struct node结构变量的指针D.p是struct node结构变量

  • 查看答案
  • 有以下程序: #include struct STU {int num; fl

    [单选题]有以下程序: include struct STU {int num; float TotalScore;有以下程序: #include <strino.h> struct STU {int num; float TotalScore; }; void f(struct STU p) {struct STU s[2]={{20044,550},{20045,537}}; p.num=s[1].num;p.TotalScore=s[1].TotalScore; } main() {struct

  • 查看答案
  • 有以下程序 #include struct NODE { int num;str