单项选择题

有以下程序:
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

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

单项选择题
有以下程序: #include <strino.h> struct STU {int num; float TotalScore;}; void f(struct STU p) {struct STU s[2]={{20044,550},{20045,537}}; p.num=s[1].num;p.TotalScore=s[1].TotalScore; } main() {struct STU s[2]={{20041,703},{20042,580}}; f(s[0]); printf( %d%3.0t n ,s[0].num,s[0].TotalScore); } 程序运行后的输出结果是()。

A.20045 537
B.20044 550
C.20042 580
D.20041 703

单项选择题
有以下程序: #include <string.h> struct STU {char name[10]; int num; }; void f(char *name, int num) {struct STU s[2]={{ SunDan ,20044}.{ Penghua ,20045}}; num=s[0].num; strcpy(name,s[0].name); } main() {struct STU s[2]={{ YangSall ,20041},{ LiSiGao ,20042}},*p;p=&s[1]; f(p->name,p->num); printf( %s%d n ,p->name,p->num); } 程序运行后的输出结果是()。

A.SunDan 20042
B.SunDan 20044
C.LiSiGuo 20042
D.YangSan 20041

相关试题
  • 有以下程序: struct STU {char name...
  • 有以下程序: #include <stdio.h> m...