单项选择题

有以下程序:
#include <stdio, h>
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);
prinff("% d \n" ,s);
程序运行后的输出结果是( )。

A.26
B.28
C.29
D.24
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序,其中函数f的功能是将多个字符串按字典顺序排序:#include <stdio, h>#inelude <string, h>void f(char * p[ ] ,int n) char * t;int i,j; for(i=0;i<n-1;i++) for(j=i+1 ;j<n;j ++ ) if(strcmp(p[i], p[j])>0) t =p[i];p[i] =p[j] ;p[j] =t;main( ) char * p [5] = abe . aabdfg . abbd , dcdbe , cd ; f(P,5 ); printf( % d n , strlen(p[1]) );程序运行后的输出结果是( )。
A.2
B.3
C.60
D.4
单项选择题
有以下程序: #include <stdio.h>#include <string.h>void f(char * s,char*t) char k; k=*s; *s=*t; *t=k; s++; t--; if( * s) f(s,t);main( ) char str[10] : abedefg , * p; p = str + strlen(str) 2+1; f(p,p -2); printf( % s n ,str);程序运行后的输出结果是( )。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
相关试题
  • 以下函数rotate的功能是:将a所指N行N列的...
  • 以下程序运行后的输出结果是 【15】 。...
  • 以下程序的功能是计算:s=1+12+12...
  • 以下程序运行后的输出结果是 【17】 。...
  • 以下函数sstrcat的功能是实现字符串的连接...