单项选择题

有以下程序
int a=2;
int f(int n)
static int a=3;
int t=0;
if(n%2) static int a=4; t+=a++;
else static int a=5; t+=a++;
return t+a++;main()
int s=a, i;
for( i=0; i<3; i++) s+=f(i);
 printf("%d\n", s);程序运行后的输出结果是______。
(A) 26
(B) 28
(C) 29
(D) 24

<上一题 目录 下一题>
热门 试题

单项选择题
以下对结构体类型变量td的定义中,错误的是______。
A) typedef struct aa
int n;
float m;AA;AA td;
B) struct aa
int n;
float m;
td;
struct aa td;
C) struct
int n;
floatm;
aa;
struct aa td;
D) struct
int n;
float m;
td;
单项选择题
执行以下程序后,test.txt文件的内容是(若文件能正常打开)______。#includemain() FILE *fp; char *s1= Fortran ,*s2= Basic ; if((fp=fopen( test.txt , wb ))==NULL) printf( Can′t open test.txt file n );exit(1); fwrite(s1,7,1,fp); *把从地址s1开始的7个字符写到fp所指文件中* fseek(fp,0L,SEEK_SET); *文件位置指针移到文件开头* fwrite(s2,5,1,fp); fclose(fp);(A) Basican(B) BasicFortran(C) Basic(D) FortranBasic
相关试题
  • 在int (*prt)[3];定义中,标识符pr...