【简答题】【消耗次数:1】
结构体数组中存有3个人的姓名和年龄,以下程序输出3个人中最年长者的姓名和年龄,在横线上填上正确的内容。static struct man{ char name[20];int age;}person[]={{zhang-hua,18},{li-dong,20},{wang-ping,22}};main(){ struct man *p,*q;int old=0;for[填空1];[填空2];p++)if (oldage){ q=p;[填空3];}printf(%s%d,[填空4]);}
参考答案:
复制
纠错
相关题目
【简答题】 #includestdio.hint main(){int a[10]={0,1,2,3,4,5,6,7,8,9};int *p;p=a;printf(%d\n,*p);p++;printf(%d\n,*p);}程序输出结果为[填空1]和[填空2]。
【简答题】 int a[10]={0,1,2,3,4,5,6,7,8,9};int *p;int i;p=a;printf(%d\n,*p++);printf(%d\n,*++p);程序输出结果为[填空1]和[填空2]。
【简答题】 在以下嵌套结构中填空。#includestdio.hstruct date{ int month;int day;int year;};struct student{[填空1]name[20];[填空2]age;[填空3]sex;[填空4]date_birthday;[填空5]department[30];};
【单选题】 以下程序的运行结果是()。main(){inta[3]={1,2,3};int*num[3];int**p,i;for(i=0;ii++)num[i]=p=num;printf("%d",**p);}
①  1
②  3
③  a[0]
④  num
【简答题】 下面程序以每行4个数据的形式输出a数组。#define N 20 #include stdio.hvoid main() { int a[N],i;for(i=0; i i++) scanf(%d,[填空1]);for(i=0; i i++) { if([填空2]) [填空3]; printf(%3d,a[i]);}}
【单选题】 以下程序运行的输出结果是。main(){ int p=30;printf(%d\n,(p/320?p/10:p%3)); }
①  0
②  1
③  2
④  3
【简答题】 以下程序输入20个数,将其逆序输出。#includestdio.hvoid main() { int a[20],i; for(i=0;ii++) scanf(%d,[填空1]); for(i=19;ii--) printf(%d ,[填空2]); }
【多选题】 以下说法正确的是(  )。#include stdio.hint main(){struct student // 声明结构体类型struct student {int num;char name[20];float score;}student1;
①  student是变量名
②  student是类型名
③  student1是变量名
④  student1类型名
【单选题】 下述程序的运行结果( )。 #includevoid main() { int p,a=0; if(p=a!=0)printf(%d\n else printf(%d\n,p+2); }
①  1
②  2
③  3
④  5
【单选题】 若有下面定义,对结构体变量成员不正确引用的语句是()。structpup{charname[20];intage;intsex;}p[3],*q;q=p;
①  scanf("%s",p[0].name);
②  scanf("%d",q
③  -scanf("%d",(q
④  -scanf("%d",p[0].age);
随机题目
【单选题】 Something ( ) hung in the air between them.
①  update
②  uniform
③  union
④  unspoken
【单选题】 Money is not ( )to happiness.
①  basic
②  necessary
③  essential
④  support
【单选题】 This is an opportunity to ( )the reputation of the university.
①  improve
②  enhance
③  high
④  lengthen
【单选题】 The ( )situation for this country is promising.
①  overall
②  wholly
③  completely
④  maximal
【单选题】 Lets toss a ( )to decide who should go.
①  paper
②  coin
③  trunk
④  water
【单选题】 Shes an easy ( ) for their criticisms.
①  tariff
②  tarnish
③  talent
④  target
【单选题】 Theyre trying to ( ) this math problem.
①  figure up
②  figure on
③  figure out
④  figure in
【单选题】 There has been an atmosphere of ( ) around here for a few days now.
①  anticipation
②  greeting
③  knowledgw
④  knowing
【单选题】 The( ) between the parts of the novel is apparent.
①  continuity
②  lasting
③  continuous
④  continue
【单选题】 Without them you will not be able to( ) the tasks
①  fulfillment
②  fulfil
③  fulfilled
④  fulfilling