网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
若有如下定义,则下面能输出字母M的语句是()。struct person{ char name[9]; int age; }; struct person class[10]={"John",17,"paul",19,"Mary",18,"Adam",16};
A.printf("%cn",class[3].name);
B.printf("%cn",class[3].name[1]);
C.printf("%cn",class[2].name[1]);
D.printf("%cn",class[2].name[0]);
参考答案和解析
A
更多 “若有如下定义,则下面能输出字母M的语句是()。struct person{ char name[9]; int age; }; struct person class[10]={"John",17,"paul",19,"Mary",18,"Adam",16};A.printf("%cn",class[3].name);B.printf("%cn",class[3].name[1]);C.printf("%cn",class[2].name[1]);D.printf("%cn",class[2].name[0]);” 相关考题
考题
若有下面说明和定义:struct test{ int m1;char m2;float m3;union uu(char u1[5];int u2[2];)ua;}myaa; 则sizeof(struct test)的值是( )。A)20 B)16C)14 D)9
考题
根据下列定义,能打印出字母P的语句是( )。struct stu{char name[10];int age;};struct stu s[10]={"John",11,"Pau1",12,"Mary",11,"adam",12};A.primf("%c",s[3].name};B.primf("%c",s[3].name[1]);C.printf("%c",s[2].name[1]);D.printf("%c",s[1].name[0]);
考题
根据下列的定义,能打印出字母P的语句是( )struct stu {char name[10];int age;};stmct stu s[10]={"John",11,"Paul",12,"Mary",11,"adam",12}:A.printf("%c",s[3].name);B.printf("%c",s[3].name[1]);C.printf("%c",s[2].name[11]);D.printf("%c",s[1].name[0]);
考题
若有下面的说明和定义struct test{ int ml; char m2; float m3;union uu {char ul[5]; int u2[2];} ua;} myaa;则sizeof(struct test )的值是A.12B.16C.14D.9
考题
有如下定义struct person{char name[9];int age;};struct person class[10]={"John",17,"paul",19,"Mary",18,"Adam",16,};根据上述定义,能输出字母M的语句是A.printf("%c\n",class[3].name);B.printf("%c\n",class[3].name[1]);C.printf("%c\n",class[2].name[1]);D.printf("%c\n",class[2].name[0]);
考题
根据下面的定义,能印出字母m的语句是()根据下面的定义,能印出字母M的语句是()structperson{charname[9];intage;};structpersonclass[10]={“john”,17,“paul”,19,“mary”,18,“adam”,16};。
A.printf(“%c\n”,class[3].name);B.printf(“%c\n”,class[3].name[1]);C.printf(“%c\n”,class[2].name[1]);D.printf(“%c\n”,clsaa[2].name[0]);
考题
有以下程序:includeincludeusingnameSpacestd;classperson{ intage; Char*nam
有以下程序:include <iostream>include <string>using nameSpace std;class person{int age;Char * name;public:person ( int i, Char * str ){int j;j = strlen( str ) + 1;name = new char[ j ];strcpy( name, str );age = i;}~person(){delete name;cout<<"D";}void display(){cout<<name<<":"<<age;}};int main(){person demo( 30,"Smith" );demo.display();return 0;}则该程序的输出结果为:【 】。
考题
有如下定义: struct person{char name[9];int age;}; struct person class[10]={"Johu",17,"Paul",19,"Mary",18,"Adam",16,};根据上述定义,能输出字母M的语句是______。A.printf("%c\n",class[3].name);B.printf("%c\n",class[3].name[1]);C.printf("%c\n",class[2].name[1]);D.printf("%c\n",class[2].name[O]);
考题
有如下定义: struct person {char name[9];int age;} struct person class[10]={ "John",17, "Paul",19, "Mary",18, "Adam",16}; 能输出字母M的是( )A.printf("%c\n",class[3].name);B.printf("%c\n",class[3].name[1]);C.printf("%c\n",class[2].name[1]);D.printf("%c\n",class[2].name[0]);
考题
根据下面的定义,能打印出字母M的语句是( )。 struct person { char name[9]; int age; }; struct person class[10]={"John",17,"Paul",19,"Mary",18,"Adam",16};A.printf("%c\n",class[3].name};B.printf("%c\n",class[2].name[0]);C.printf("%c\n",class[3].name[1]);D.printf("%c\n",class[2].name[1]);
考题
若有如下说明和定义struct test{ int ml; char m2; float m3; union uu {char ul[5]; int u2[2];} ua;} myaa;则sizeof(struct test)的值是A.12 B.16 C.14 D.9
考题
设有以下语句: struct SS { int no; char name[10];}PERSON; 则下面叙述中错误的是 ( )A.struct是结构体类型的关键字B.struct SS是结构体类型C.PERSON是结构体类型名D.name是结构体成员名
考题
根据下列的定义,能打印出字母P的语句是( )。 struct stu { char name[10]; iht age; }; struct stu s[10]={"John",11, "Paul", 12, "Mary", 11, "adam",12 };A.printf("%c",s[3].name);B.printf("%c",s[3].name[1]);C.printf("%c",s[2].name[1]);D.printf("%c",s[1].name[0]);
考题
定义下列结构体(联合)数组: struct St { char name[15]; int age; }a[10]={"ZHAO",14,"WANG",15,"LIU",16,"ZHANG",17}; 执行语句printf("%d,%c",a[2].age,*(a[3].name+2))的输出结果为( )。A.15,AB.16,HC.16,AD.17,H
考题
定义下列结构体(联合)数组: struct st { char name[15]; int age; }a[10]={"ZHA0",14,"WANG",15,"LIU",16," ZHANG",17); 执行语句printf("%d,%C",a[2].age,*(a[3].name+ 2))的输出结果为( )。A.15,AB.16,HC.16,AD.17,H
考题
若有如下定义: 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
考题
定义下列结构体(联合)数组:struct st{ char name[15];int age;}a[10]={ZHA0,14,ZHA0,14,WANG,15,LIU,16, ZHANG,17);执行语句printf(%d,%C,a[2].age,*(a[3].name+ 2))的输出结果为( )。A.A.15,AB.16,HC.16,AD.17,H
考题
有以下程序: #includestdio.h struct stu { int num; char name[10]: int age;} void fun(struct stu*p) {printf("%s\n",(*p).name);} the main { struct stu students[3]={{9801,"Zhang".20}, {9802,"Wang",19},{9803,"Zhao",1 8}} fun(students+2); } 输出的结果是( )。A. ZhangB.ZhaoC.WangD.18
考题
以下程序的输出结果是______。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
考题
某C语言结构体的定义如下。 struct date { int year, month, day; }; struct worklist { char name[20]; char sex; struct date birthday; }person; 若对变量person的出生年份进行赋值,正确的赋值语句是(33)。A.year=1976B.birthday. year=1976C.person. year=1976D.person. birthday. year=1976
考题
根据下述定义,能输出字母M的语句是( )。struct person { char name[9]; int age;}class[10]={"Johu",17,"Paul",19,"Mary",18,"Adam",16};
A、prinft("%c\n",class[3].nane);B、pfintf("%c\n",class[3].name[1]);C、prinft("%c\n",class[2].name[1]);D、printf("%c\n",class[2].name[0])
考题
设有如下定义 struct ss { char name[10]; int age; char sex; }std[3], * p=std; 下面各输入语句中错误的是A.cin>>(* p).age);B.cin>>std.name);C.cin>>std[0].sex);D.cin>>(p->.sex));
考题
下列关于结构型变量的定义语句中,错误的是( )A.typedef struct CCCB.define GGG struct { char name[20];GGG CCC { char name[20]; int age; int age; }GGG; }; GGG abc ; GGG CCC abc;C.structD.struct { char name[20]; { char name[20]; int age; int age; }ccc; }abc; CCC abc;
考题
根据下列的定义,能打印出字母P的语句是( )。 struct stu {char name[10]; int age; }; struct sm s[10]={"John",11, "Pau1",12, "Mary",11, "adam",12 };A.printf("%c",s[3].name);B.printf("%c",s[3].name[1]);C.printf("%c",s[2].name[1]);D.printf("%c",s[1].name[0]);
考题
若有下面的说明和定义: struct test { int m1; char m2; float m3; union uu {char ul[5]; int u2[2];} ua; }myaa;则sizeof(struct test)的值是( )。A.12B.16C.14D.9
考题
单选题有以下函数:#include struct stu{ int num; char name[10]; int age;};void fun(struct stu *p){ printf(%s, p-name);}main(){ struct stu x[3] = {{01,Zhang,20}, {02,Wang,19}, {03,Zhao,18}}; fun(x+2);}程序运行后的输出结果是( )。A
ZhangB
ZhaoC
WangD
19
考题
单选题有如下程序:#include struct person{ char name[10]; int age;};main(){ struct person room[4] = {{Zhang,19}, {Li,20}, {Wang,17}, {Zhao,18}}; printf(%s:%d,(room+2)-name, room-age);}程序运行后的输出结果是( )。A
Wang:19B
Wang:17C
Li:20D
Li:19
考题
单选题有如下程序:#include struct person{ char name[10]; int age;};main(){ struct person room[2] = {{Wang,19},{Li,20}}; printf(%s:%d,(room+1)-name, room-age);}程序运行后的输出结果是( )。A
Li:19B
Wang:19C
Li:20D
Wang:17
热门标签
最新试卷