根据下面的定义,能输出字符串'Mary'的语句是( )。struct worker{char name[18]; int age;};struct worker w[100]={"John",16,"Paul",17,"Mary",17 };
A: printf("%s",w[1].name);
B: printf("%s",w[2].name);
C: printf("%s",w[1]);
D: printf("%s",w[2]);
A: printf("%s",w[1].name);
B: printf("%s",w[2].name);
C: printf("%s",w[1]);
D: printf("%s",w[2]);
举一反三
- 根据下面的定义,能输出字母'P'的语句是( )。struct worker{char name[18]; int age;};struct worker w[100]={"John",16,"Paul",17,"Mary",16 }; A: printf("%c",w[2].name[1]); B: printf("%c",w[1].name[0]); C: printf("%c",w[1].name); D: printf("%c",w[2].name[0]);
- 对以下定义,能输出字符串"Mary"的语句是( )。struct student { char name[20]; int age; }; struct student stu[100]={"John",16,"Paul",17,"Mary",18 }; A: printf("%s",stu[2].name); B: printf("%s",stu[1].name); C: printf("%s",stu[2]); D: printf("%s",stu[1]);
- 根据下列的定义,能打印出字母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 person{ char name[9]; int age;}; struct person class[4]={ "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[0]);
- 根据下述定义,能输出字母M的语句是:strcut person{char name[9];int age;};struct person class[10]={"John",17,"Paul",19,"Mary",18,"Adam",16}; A: class[3].name B: class[2].name[0] C: class[3].name[1] D: class[2].name[1]