printf(“%d, %d, %d”,*a[1],*(a[1]+2) , *(*(a+2)+3)*2); 11. 写出如下程序段的输出结果。 union{
int b1, b2, b3; } yy;
y.b1=1; y.b2=2; y.b3=10*y.b1+y.b2; printf(“%d, %d, %d”, y.b1, y.b2, y.b3); 试题三、程序填空题(每空 2 分,共 16 分)
1.输入某班30位学生的姓名及数学,英语,计算机三门课成绩,输出平均成绩>=60分的学生的姓名及其各门课的成绩。 #include
int math, english, computer; };
void main()
{ struct student s[SIZE]; int k,j,n,d[SIZE]; float average;
for(k=0;k for(n=0,k=0;k average=(s[k].math+s[k].englksh+s[k].computer)/3.0; if ( 2 ) { d[n]=k; 3 ; } } for (k=0;k printf(\ish,s[j].computer); } } 2.函数 fsort 判断以 head 为头指针的链表是否按 value 域值升序排列(value的值均为正数)。若按升序排列返回1,否则返回0。 struct nlist { int value; struct nlist *next; }; int fsort( 5 ) { struct nlist *p; int n=0; for (p=head; 6 ; p->next) if( 7 ) break; else 8 ; return(!p); } 试题四、程序阅读题 ( 共 30 分,每小题1、写出程序运行结果。 #include int k, j=2, *p=a[0]; for ( k = 0; k < 5; k++ ) *p++ = k + j ++; 6 分 ) for(k=0;k<2;k++) { for(j=0;j<3;j++) printf(\printf(\} } 2、写出程序运行后file2.txt的内容。 #include FILE *in, *out; char *string2 = \char *string1 = \if ((in = fopen(\while(*string1 != '.') fputc(*string1++,in); fclose(in); if(((in=fopen(\(\{ while(!feof(in)) { fgetc(in); fputc(*string2++,out);

