单项选择题
有以下程序:
#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
点击查看答案&解析
单项选择题
有以下程序段: int n,t=1,s=0; scanf( % ,&n); do s=s+t; t=t-2; while(t!=n); 为使此程序段不陷入死循环,从键盘输入的数据应该是( )。
A.任意正奇数
B.任意负偶数
C.任意正偶数
D.任意负奇数
点击查看答案&解析
相关试题
有以下程序: #include <stdio, h>v...
有以下程序:#include <stdio.h>strue...
有以下程序:#include <stdlo.h>main...
有以下程序:#include <stdio, h>#i...
有以下程序:#include <stdio.h>float...