题目内容

以下结构体类型说明和变量定义中正确的是______。

A. typedef struct int n;char c;REC;
B. REC t1,t2;
C. struct REC;
D. int n;char c;);
E. REC t1,t2;
F. typedef struct REC;
G. int n=0;char c=’A’;t1,t2;
H. struct
I. int n;char c;REC;
J. REC t1,t2;

查看答案
更多问题

以下程序依次把从终端输入的字符存放到f文件中,用#作为结束输入的标志,则在横线处应填入的选项是______。 #include<stdio.h> main() FILE*fp;char ch; fp=fopen("fname","w"); while((ch=getehar())!=’#’)fputo(______); fclose(fp);

A. ch,fp
B. fp,ch
C. ch
D. ch,"fname\

若有定义语句 int h=2; 则表达式(b<<2)/(3||b)的值是()。

A. 8
B. 2
C. 4
D. 0

有以下程序 #include<stdio.h> struct Sint n;int a[20];; void f(struct S*P) int i,j,t; for(i=0;i<p->n-1;i++) for(j=i+1;j<p->n;j++) if(p->a[i]>p->a[j])t=p->a[i];p->a[i]=p->a[j];p->a[j]=t; main() int i;struct S s=10,2,3,1,6,8,7,5,4,10,9; f(&s); for(i=0;i<s.n;i++)printf("%d,",s.a[i]); 程序运行后的输出结果是______。

A. 1,2,3,4,5,6,7,8,9,10,
B. 10,9,8,7,6,5,4,3,2,1,
C. 2,3,1,6,8,7,5,4,10,9,
D. 10,9,8,7,6,1,2,3,4,5,

有以下程序 #include<stdio.h> #include<string.h> typedef structchar name[9];char sex;float score[2]; STU; STU f(STU a) STU b="Zhao",’m’,85.0,90.0;int i; strcpy(a.name,b.name); a.sex=b.sex; for(i=0;i<2;i++)a.seore[i]=b.score[i]; return a; main() STU c="Qian",’f1,95.0,92.0,d; d=f(c); printf("%s,%c,%2.0f,%2.0f\n",d.name,d.sex,d.score[0],d.score[1]); 程序的运行结果是______。

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

答案查题题库