网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

若有如下程序: 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.33

B.85

C.86

D.86.67


参考答案

更多 “ 若有如下程序: 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 ” 相关考题
考题 有以下程序#include stdio.h#include string.htypedef struct{ char name[9];char sex; float score[2]; } STU;STU f(STU a){ STU b={"Zhao",'m',85.0,90.0}; int i;strcpy(a.name,b.name);a.sex=b.sex;for(i=0;i2;i++) a.score[i]=b.score[i];return a;}main(){ STU c={"Qian",'f',95.0,92.0},d;d=f(c); printf("%s,%c,%2.0f,%2.0f\n",d.name,d.sex,d.score[0],d.score[1]);}程序的运行结果是A)Qian,f,95,92B)Qian,m,85,90C)Zhao,m,85,90D)Zhao,f,95,92

考题 下列语句段中,正确的是( )。A.struct{int x;float y;int a[2];unsigned b[3];char name[10];};B.struct stu{unsigned a[3];unsigned b[4];}x;int*p=x.a;C.struct stu{int a;float x[4];}y={1,1.0};float data=y.x;D.struct nd{int a,b;unsigned c[2]=5;};

考题 有以下程序: 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; for(i=0;i<3,i++) sum=sum+p->score[i]; printf("%6.2f\n",sum); } 程序运行后的输出结果是( )。A.260B.270C.280D.285

考题 有下列程序:includeinclude "string.h"typedef struct{char name[9]; char sex;float 有下列程序: #include <stdio.h> #include "string.h" typedef struct{char name[9]; char sex;float score[2];}STU; void f(STU A) { STU b={"Zhao",'m',85.0,90.0}; int i; strcpy(a.name,b.name); a.sex=b.sex; for(i=0;i<2;i++) a.score[i]=b.score[i]; } main() { STU c={"Qian",'f',95.0,92.0}; f(C) ; printf("%s,%c,%2.0f,%2.0f\n",c.name,c.sex,c.score[0],c.score[1]); } 程序的运行结果是( )。A.Qian,f,95,92B.Qian,m,85,90C.Zhao,f,95,92D.Zhao,m, 85,90

考题 有以下程序:street 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; for(i=0;i<3 ,i++) sum=sum+ p->score[i]; printf("%6.2f\n",sum);}程序运行后的输出结果是( )。A.260B.270C.280D.285

考题 下面程序和运行运行结果是【 】。typedef union student{ char name [10];long sno;char sex;float score [4];} STU;main ( ){ STU a[5];prinff( "% d\n", sizeof(a) );}

考题 有以下程序 include include typedef struct { cha 有以下程序 #include <stdio.h> #include <string.h> typedef struct { char name[9]; char sex; float score[2]; } STU; STU f(STU a) { STU b={"Zhao", 'm', 85.0, 90.0}; int i; strcpy(a.name, b.name); a.sex = b.sex; for (i=0; i<2; i++) a.score[i] = b.score[i]; return a; } main() { STU c={"Qian", T, 95.0, 92.0}, d; d=f(c); printf("%s,%c,%2.0f,%2.0f\n", d.name, sex, score[O], d.score[1]); } 程序的运行结果是A.Qian, f,95,92B.Qian,m,85,90C.Zhao,m,85,90D.Zhao,f,95,92

考题 若有如下程序段: 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

考题 有以下程序 include main() { struct STU{char name[9];char sex;double 有以下程序 #include <stdio.h> main() { struct STU{char name[9];char sex;double score[2];}; sturt STU a={"Zhao" ,'m',85.0,90.0},b={"Qian" ,'f,95:0,92.0}; b=a; printf("%s,%c,%2.0f,%2.0f\n",b.name,b.sex,b.score[0],b.score[1]); } 程序的运行结果是______。A.Qian,f,95,92B.Qian,85,90C.Zhao,f,95,92D.Zhao,m,85,90

考题 有如下说明和定义语句: struct student { int age; char num{8};}; struct student stu[3]={{20,"200401"},{21,"200402"),{19,"200403"}}; struct student *p=stu; 以下选项中引用结构体变量成员的表达式错误的是( )。A.(p++)->numB.p->numC.(*p).numD.stu[3].age

考题 下面程序的运行结果是typedef union student{ char name[10]; long sno; char sex; float score[4];}STU;main(){ STU a[5]; printf("%d\n",sizeof(a));}

考题 有以下程序段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; for(i=0;i3;i++) sum=sum+p-score[i]; printf("%6.2f\n",sum); }程序运行后的输出结果是A.260.00 B.270.00 C.280.00 D.285.00

考题 若有如下定义: struct stu{char name[9];int age;float score;); struct stu class[10]={{"Li",17,67},{"Song",19,80}, {"guo",18,79},{"Zhao",16,69}}; 根据上面的定义,若执行“printf("%s:%d%f",class[3].name,class[3].age,class[3].score);"则输出的正确结果是( )。A.Song:19,80.000000B.Zhao:16,69.000000C.Li:17,67Song;19,80D.guo:18,79Zhao;16,69

考题 以下程序的输出结果是______。includestruct stu{int num; char name[10]; int age;};v 以下程序的输出结果是______。#include<stdio.h>struct stu{ int num; char name[10]; int age;};void fun(struct stu*p){ printf("%s\n",(*p).name);}main(){ struct stu students[3]={ {9801,"Zhang",20}, { 9802,"Wang",19}, { 9803,"Zhao",18} }; fun(students+2);}A.ZhangB.ZhaoC.WangD.18

考题 有以下程序 include struct STU { char num[10]; float score[3];}; void ma 有以下程序 #include<iostream.h> struct STU { char num[10]; float score[3];}; void main( ) { struct STU s[3]={ { "20021",90,95,85 }, {"20022",95,80,75 }, {"20023",100,95,90 } },* p=s; int i; float sum=0; for(i=0;i<A.260B.270C.280D.285

考题 下列语句段中,正确的是( )。A.struct { int x; float y; int a[2]; unsigned b[3]; char name[ 10]; };B.struct stu { unsigned a[3]; unsigned b[4]; }x; int *p= x.a;C.street stu { int a; float x[4]; }y={1,1.0}; float data=y.x;D.struct nd {int a,b; unsigned c[2]=5; };

考题 有以下程序:includeincludetypedef struct{char name[9];char sex;float s 有以下程序: #include <stdio.h> #include <string.h> typedef struct{char name[9];char sex;float score[2]}STU; STU f(STU A) {STU b={"Zhao",'m',85.0,90.0}; int i; strcpy(a.name,b.namC) ; a.sex=b.sex; for(i=0;i<2;i++) a.score[i]=b.score[i]; return a; } main() {STU c={"Qian",'f',95.0,92.0},d; d=f(C) ; pintf("%s,%c,%2.of.%2.of\n",d.name,d.sex,d.score[0],score[1]); } 程序的运行结果是( )。A.Qian,f,95,92B.Qian,m,85,90C.Zhao,m,85,90D.Zhao,C95,92

考题 若有定义和语句:struct student { int num; char name[10]; float score;} s[5]={{1,"lili",98.5},{9,"xiaohua",66}},*p=s;printf("%d",*p++);输出结果是1。( )此题为判断题(对,错)。

考题 数据结构里,struct student { char name[20]; char sex[10]; int age; int score; }; 定义结构体后,定义变量、数组赋值正确的是()。A、struct student s={"张三","男",18,100};B、struct student stu[3]={{"张三","男",18,100},{"李四","男",19,90},{"王五","男",23,97}};C、struct student s={"李四";"女";18;100};D、struct student stu[3]={{"张三",18,"男",100},{"李四",19,"男",90},{"王五",23,"男",97}};

考题 单选题有以下程序#include #include typedef struct{ char name[9]; char sex; float score[2];} STU;STU f(STU a){ STU b={zhao,'m',85.0,90.0}; int i; strcpy(a.name, b.name); a.sex = b.sex; for(i=0; i2; i++) a.score[i]=b.score[i]; return a;}main(){ STU c={Qian,'f',95.0,92.0},d; d=f(c); printf(%s,%c,%2.0f,%2.0f, d.name, d.sex, d.score[0], d.score[1]);}程序的运行结果是(  )。A Qian,m,85,90B Zhao,m,85,90C Qian,f,95,92D Zhao,f,95,92

考题 单选题若有以下程序#include typedef struct stu{ char name[10],gender; int score; } STU;void f(STU a, STU b){ b = a; printf(%s,%c,%d,, b.name, b.gender, b.score);}main(){ STU a={Zhao, 'm', 290}, b={Qian, 'f', 350}; f(a,b); printf(%s,%c,%d, b.name, b.gender, b.score);}则程序的输出结果是(  )。A Zhao,m,290,Qian,f,350B Zhao,m,290,Zhao,m,290C Qian,f,350,Qian,f,350D Zhao,m,290,Zhao,f,350

考题 单选题有以下程序:#include #include typedef struct{ char name[9]; char sex; float score[2];} STU;void f(STU *A){ strcpy(a-name,Zhao); a-sex='m'; a-score[1]=90.0;}main(){ STU c = {Qian,'f',95.0,92.0},*d=c; f(d); printf(%s,%c,%2.0f,%2.0f, d-name, c.sex, c.score[0], c.score[1]);}程序的运行结果是(  )。A Qian,f,95,92B Zhao,f,95,90C Zhao,m,95,90D Zhao,f,95,92

考题 单选题有以下程序:#include #include typedef struct{ char name[9]; char sex; float score[2];} STU;void f(STU a){ STU b={zhao,'m',85.0,90.0}; int i; strcpy(a.name, b.name); a.sex = b.sex; for(i=0; i2; i++) a.score[i]=b.score[i];}main(){ STU c={Qian,'f',95.0, 92.0}; f(c); printf(%s,%c,%2.0f,%2.0f, c.name, c.sex, c.score[0], c.score[1]);}程序的运行结果是(  )。A Qian,f,95,92B Qian,m,85,90C Zhao,f,95,92D Zhao,m,85,90

考题 单选题若有以下程序#include #include #include typedef struct stu{ char *name,gender; int score;}STU;void f(char *p){ p=(char *)malloc(10); strcpy(p,Qian);}main(){ STU a={NULL,'m',290},b; a.name=(char *)malloc(10); strcpy(a.name,Zhao); b=a; f(b.name); b.gender='f'; b.score=350; printf(%s,%c,%d,, a.name, a.gender, a.score); printf(%s,%c,%d, b.name, b.gender, b.score);}则程序的输出结果是(  )。A Qian,m,290,Qian,f,350B Zhao,m,290,Qian,f,350C Qian,f,350,Qian,t,350D Zhao,m,290,Zhao,f,350

考题 单选题有以下程序:#include #include typedef struct stu{ char name[10]; char gender; int score;}STU;void f(char *name,char gender,int score){ strcpy(name,Qian); gender='f'; score=350;}main(){ STU a={Zhao,'m',290},b; b=a; f(b.name,b.gender,b.score); printf(%s,%c,%d,, a.name, a.gender, a.score); printf(%s,%c,%d, b.name, b.gender, b.score);}程序的运行结果是(  )。A Zhao,m,290,Qian,m,290B Zhao,m,290,Zhao,m,290C Zhao,m,290,Qian,m,350D Zhao,m,290,Qian,f,350

考题 单选题有以下程序:#include typedef struct stu{ char name[10]; char gender; int score; } STU;void f(STU *a, STU *b){ *b = *a; printf(%s,%c,%d,, b-name, b-gender, b-score);}main(){ STU a={Zhao, 'm', 290}, b={Qian, 'f', 350}; f(a,b); printf(%s,%c,%d, b.name, b.gender, b.score);}程序的运行结果是(  )。A Zhao,m,290,Zhao,m,290B Zhao,in,290,Qian,f,350C Qian,f,350,Qian,f,350D Qian,f,350,Zhao,m,290