题目内容

下面程序的功能是从终端上输入5个人的年龄、性别和姓名,然后输出。请填空#include"stdio.h"struct man{ char name[20];unsigned age;char sex[7];};data_in(struct man*p, int n ){struct man *q=________;for( ;page, p->sex);________;}}data_out( structman *p, int n ){struct man *q = ________;for( ;pname, p->age, p->sex);}int main ( ){ struct man person[5];data_in(person,5);data_out(person,5);return 0;}

查看答案
更多问题

写出以下程序段的输出结果________。struct str1{ char c[5];char *s;};struct str1 s1[2]={{"ABCD","EFGH"},{"IJK","LMN"} };struct str2{struct str1 sr;int d;}s2={"OPQ","RST",32767};struct str1 *p[2];p[0]=&s1[0];p[1]=&s1[1];printf("%s",++p[1]->s);printf("%c",s2.sr.c[2]);

写出以下程序的输出结果________。struct student{ int num; char name[10];int age;}void show(struct student *p){ printf("%s\n",(*p).name);}int main(){struct student stu[3]={{1001,”Li”,21},{1002,”Wang”,19},{1003,”Wu”,18}};show(stu+2);return 0;}

写出以下程序的运行结果________。struct test{ int x;char c;};func(struct test b){ b.x=20; b.c='y';}int main(){ struct test a={10,'x'}; func(a); printf("%d,%c",a.x,a.c);return 0;}

写出下面程序段的输出结果________。struct stu{int x,*y;}*p;int d[4]={10,20,30,40};struct stua[4]={50,&d[0],60,&d[1],70,&d[2],80,&d[3]};p=a;printf("%d,",++p->x);printf("%d,",(++p)->x);printf("%d\n,",++(*p->y));

答案查题题库