题目内容

有以下程序#include struct STU{ char name[9]; char sex; int score[2]; } ;void f( struct STU a[] ){ struct STU b = {"Zhao", 'm', 85, 90};a[1] = b;}main(){ struct STU c[2]={ {"Qian", 'f', 95, 92}, {"Sun", 'm', 98, 99} };f(c);printf( "%s,%c,%d,%d,", c[0].name, c[0].sex, c[0].score[0], c[0].score[1] );printf( "%s,%c,%d,%d\n", c[1].name, c[1].sex, c[1].score[0], c[1].score[1] );}程序运行后输出结果是

A. Qian,f,95,92,Sun,m,98,99
B. Qian,f,95,92,Zhao,m,85,90
C. Zhao,m,85,90,Sun,m,98,99
D. Zhao,m,85,90,Qian,f,95,92

查看答案
更多问题

有以下程序#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\n", b.name, b.gender, b.score);}程序的运行结果是

A. Zhao,m,290,Qian,f,350
B. Qian,f,350,Zhao,m,290
C. Qian,f,350,Qian,f,350
D. Zhao,m,290,Zhao,m,290

有以下程序#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\n", b.name, b.gender, b.score);}程序的运行结果是

A. Zhao,m,290,Qian,m,290
B. Zhao,m,290,Zhao,m,290
C. Zhao,m,290,Qian,m,350
D. Zhao,m,290,Qian,f,350

有以下程序#include typedef struct{char name[10];int age;} ST;main(){ ST stud[10]={ "Adum", 15,"Muty", 16,"Paul", 17,"Johu", 14,};┋}程序运行后不能输出字符u的语句是

A. printf("%c\n", stud[0].name[3] );
B. printf("%c\n", stud[3].name[3] );
C. printf("%c\n", stud[2].name[2] );
D. printf("%c\n", stud[1].name[1] );

有如下程序#include struct person{char name[10];int age;}main(){struct person room[4] = {{"Zhang", 19}, {"Li", 20}, {"Wang", 17}, {"Zhao", 18}};printf("%s:%d\n", (room+2)->name, room->age);}程序运行后的输出结果是

A. Wang:19
B. Wang:17
C. Li:20
D. Li:19

答案查题题库