题目内容

有以下程序#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

有如下程序#include #include struct S{char name[10];};void change(struct S *data, int value){strcpy(data->name, "****");value = 13;}main(){struct S input;int num = 4;strcpy(input.name, "THIS");change(&input, num);printf("%s,%d\n", input.name, num);}程序运行后的输出结果是

A. ****,4
B. ****,13
C. THIS,4
D. THIS,13

有如下程序#include #include struct S{char name[10];};main(){struct S s1, s2;strcpy(s1.name, "12345");strcpy(s2.name, "ABC");s1 = s2;printf("%s\n", s1.name);}程序运行后的输出结果是

ABC
B. ABC45
C. 12345
D. ABC12

答案查题题库