网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
有以下程序 struct stu { char num[10];float score[3]; }; main() { struct stu s[3]={{"20021",90,95,85},{"20022",95,80,75},{"20023",100,95,90}},*p=s; int i;float sum=0; p++; for(i=0;i<3;i++)sum=sum+p->score[i]; printf("%6.2f\n",sum); }程序运行后的输出结果是______。
A.260
B.270
C.250
D.285
参考答案
更多 “ 有以下程序 struct stu { char num[10];float score[3]; }; main() { struct stu s[3]={{"20021",90,95,85},{"20022",95,80,75},{"20023",100,95,90}},*p=s; int i;float sum=0; p++; for(i=0;i<3;i++)sum=sum+p->score[i]; printf("%6.2f\n",sum); }程序运行后的输出结果是______。A.260B.270C.250D.285 ” 相关考题
考题
若有如下程序段: struct student { int num;float score; } stu[3]={{10,85},{60,58},{32,23}}; main() { struct student*t; t=stu; } 则下面表达式中值为58的是( )。A.(*t).numB.*(t++)->numC.(*++t)scoreD.(++t)->score
考题
有以下程序#include "stdio.h"main(){ struct date { int number; float fenzhi; char name; }stu; printf("%d\n",sizeof(stu));} 程序的运行结果是A.3 B.5C.7 D.8
考题
若有如下程序: struct student {char name[10]; float score[3];}stu[3]={{"lili",75,90,90}, {"liudan",90,85,75}; {"guoli",85,85,70}}; main() {int i;float sum=0,aver; for(i=0;i<3;i++) sum=sum+stu[i].score[1]; aver=sum/i; printf("%6.2f\n",aver); } 则程序运行后的输出结果是( )A.83.33B.85C.86D.86.67
考题
有以下的结构体变量定义语句: struct student { int num; charname[9]; } stu; 则下列叙述中错误的是()。A.结构体类型名为stuB.num是结构体成员名C.struct是C的关键字D.结构体名为student
考题
设有以下结构体定义及初始化,表达式p->score的结果是()。 struct node { int num; float score; }stu[2]={101,91.5,102,92.5},*p=stu; A)101 B)91.5 C)102 D)92.5A.分析错误#B.该定义使stu[0].num=101,stu[0].score=91.5,stu[1].num=102,stu[0].score=92.5,p指向数组stu的首地址,p->score的值是stu[0].score。#C.分析错误#D.分析错误
考题
【单选题】以下结构体的定义语句中,正确的是______。A.struct student {intnum; char name[10];int age;};stu;B.struct {int num;char name[10];int age;}student; struct studentstu;C.struct student {int num; char name[10];int age;}stu;D.struct student {int num; char name[10]; int age;}; student stu;
考题
有以下的结构体变量定义语句: struct student { int num; charname[9]; } stu; 则下列叙述中错误的是()。A.结构体类型名为stuB.num是结构体成员名C.struct是C的关键字D.结构体类型名为student
考题
7、若能使程序运行后的输出结果如下: 201501 201502 201503 则空白处填写的表达式或语句应该是 #include <stdio.h> struct student { int age; char num[8]; }; int main() { struct student stu[3]={{20,"201501"},{21,"201502"},{19,"201503"}}; struct student *p=stu; ____________________ return 0; }A.printf("%s\n",(*p).num); printf("%s\n",(p)->num); printf("%s\n",stu[2].num);B.printf("%s\n",(p++).num); printf("%s\n",(p++).num); printf("%s\n",(p++).num);C.printf("%s\n",(p)->num); printf("%s\n",(p)->num); printf("%s\n",(*p).num);D.printf("%s\n",stu[0]->num); printf("%s\n",stu[1]->num); p
考题
以下结构体的定义语句中,正确的是______。A.struct student {int num; char name[10];int age;};stu;B.struct {int num; char name[10];int age;}student; struct student stu;C.struct student {int num; char name[10];int age;}stu;D.struct student {int num; char name[10]; int age;}; student stu;
考题
6、若能使程序运行后的输出结果如下: 201501 201502 201503 则空白处填写的表达式或语句应该是#include <stdio.h> struct student { int age; char num[8]; }; int main() { struct student stu[3]={{20,"201501"},{21,"201502"},{19,"201503"}}; struct student *p=stu; ____________________ return 0; }A.printf("%s\n",(*p).num); printf("%s\n",(p)->num); printf("%s\n",stu[2].num);B.printf("%s\n",(p++).num); printf("%s\n",(p++).num); printf("%s\n",(p++).num);C.printf("%s\n",(p)->num); printf("%s\n",(p)->num); printf("%s\n",(*p).num);D.printf("%s\n",stu[0]->num); printf("%s\n",stu[1]->num); p
热门标签
最新试卷