定义以下结构体数组,运行程序,程序输出结果是()。 #include <iostream> using namespace std; int main() { struct c { int x; int y; } s[2]={1,3,2,7}; cout<
B、6
C、14
D、21
B、6
C、14
D、21
第1题
A、结构体数组的数组元素是结构体类型
B、struct student information[100]; 该语句定义了information结构体数组,它的数据类型是student
C、在进行以下定义时,struct student 必须是已经定义的结构体数据类型 struct student information[100];
D、以下语句定义结构体数组,数组完整名称为struct student information。 struct student information[100];
第2题
A、struct POINT{ public double x;//横坐标 public double y;//纵坐标 } POINT[] p; p=new POINT[100];
B、struct POINT{ public double x;//横坐标 public double y;//纵坐标 } POINT p[100];
C、struct POINT{ public double x;//横坐标 public double y;//纵坐标 } POINT p[]=new POINT[100];
D、struct POINT{ public double x;//横坐标 public double y;//纵坐标 } POINT p=new POINT[100];
第3题
A、14
B、6
C、2
D、21
第7题
struct STD
{ char name[10];
int age;
char sex;
} s[5],*ps;
ps=&s[0];
则以下 scanf 函数调用语句中错误引用结构体变量成员的是
A)scanf("%s",s[0].name);
B)scanf("%d",&s[0].age);
C)scanf("%c",&(ps->sex));
D)scanf("%d",ps->age);
第8题
A、struct student { int num; char name[20]; char sex; int score; } student1,student2;
B、struct { int num; char name[20]; char sex; int score; }student1, student2;
C、struct student { int num; /* 学号 */ char name[20]; /* 姓名 */ char sex; /* 性别 */ int score; /* 成绩 */ }; ...... struct student student1, student2;
D、struct student student1, student2; ...... struct student { int num; /* 学号 */ char name[20]; /* 姓名 */ char sex; /* 性别 */ int score; /* 成绩 */ };
第9题
有以下结构体说明和变量定义,如图所示,指针p、q、r分别指向一个链表中的三个连续结点。现要将q和r所指结点的先后位置交换,同时要保持链表的连续,以下错误的程序段是 struct node { int data; struct node *next; }*p, *q, *r;
A、r->next=q; q->next=r->next; p->next=r;
B、q->next=r->next; p->next=r; r->next=q;
C、p->next=r; q->next=r->next; r->next=q;
D、q->next=r->next; r->next=q; p->next=r;
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!