单选题

设有以下函数:intf(inta){intb=0;staticc=3;b++;c++;return(a+b+c);}如果在下面的程序中调用该函数,则输出结果是__.voidmain{inta=2,i;for(i=0;i<3;i++)printf(%d ,f(a));}()

A. 7 8 9
B. 7 9 11
C. 7 10 13
D. 7 7 7

查看答案
该试题由用户187****22提供 查看答案人数:25346 如遇到问题请 联系客服
正确答案
该试题由用户187****22提供 查看答案人数:25347 如遇到问题请联系客服

相关试题

换一换
单选题
若有以下类Z说明,则函数fStatic中访问数据a错误的是()lass Z { static int a;public: static void fStatic();};int Z::a=0;Z objZ;
A.void Z::fStatic(){ objZ.a =1; } B.void Z::fStatic(){ a = 1; } C.void Z::fStatic(){ this->a = 0; } D.void Z::fStatic(){ Z::a = 0; }
答案
单选题
若有以下类Z说明,则函数fStatic中访问数据a错误的是()。class Z { static int a;public: static void fStatic();};int Z::a=0;Z objZ;
A.void Z::fStatic(){ objZ.a =1; } B.void Z::fStatic(){ a = 1; } C.void Z::fStatic(){ this->a = 0; } D.void Z::fStatic(){ Z::a = 0; }
答案
单选题
若有以下类Z说明,则函数fStatic中访问数据a错误的是()。class Z { static int a;public: static void fStatic();};int Z::a=0;Z objZ;
A.void Z::fStatic(){ objZ.a =1; } B.void Z::fStatic(){ a = 1; } C.void Z::fStatic(){ this->a = 0; } D.void Z::fStatic(){ Z::a = 0; }
答案
单选题
若有以下类Z说明,则函数fStatic中访问数据a错误的是()lass Z { static int a;public: static void fStatic();};int Z::a=0;Z objZ;
A.void Z::fStatic(){ objZ.a =1; } B.void Z::fStatic(){ a = 1; } C.void Z::fStatic(){ this->a = 0; } D.void Z::fStatic(){ Z::a = 0; }
答案
主观题
若有以下类Z说明,则函数fStatic中访问数据a错误的是: class Z { static int a; public: static void fStatic(Z&); }; int Z::a=0; Z objZ;
答案
单选题
设有以下函数
A.D)void (*pf)(int,char);pf=&fun; B.B)viod *pf(); pf=fun; C.C)void *pf(); *pf=fun;
答案
单选题
( 25 )设有以下函数过程
A.D ) a 除以 b 的商的整数部分 B.Do C.End function D.Loop Until c Mod b=0 E.若调用函数 fun 时的实际参数都是自然数,则函数返回的是
答案
单选题
设有以下函数过程:Functiofu(AInteger,Ainteger)DiAIntegerIa
A.a、b的最大公约数 B.a、b的最小公倍数 C.a除以b的余数 D.a除以b的商的整数部分
答案
单选题
设有以下程序段int x=0,s=0;
A.while(!x!=0)s+=++x; B.程序段执行无限次 C.运行程序段后输出0 D.运行程序段后输出1 E.程序段中的控制表达式是非法的
答案
主观题
若有函数定义: int func() { static int m=0; return m++; } 以下程序段运行后屏幕输出为。 int i; for(i=1;i<=4;i++) func(); printf("%d",func());
答案
热门试题
设有以下函数:intf(inta){intb=0;staticc=3;b++;c++;return(a+b+c);}如果在下面的程序中调用该函数,则输出结果是__.voidmain{inta=2,i;for(i=0;i<3;i++)printf(%d ,f(a));}() 设有以下函数过程  Function fun(a As Integer,b As Integer)  Dim c As Integer  If a 函数f定义如下,执行语句“sum=f(5)+f(3);”后,sum的值应为。 int f(int m) { static int i=0; int s=0; for(;i<=m;i++) s+=i; return s; } 设有如下类:class Loop{ public static void main(String[ ] args) { int x=0;int y=0; outer: for(x=0;x<100;x++){ middle: for(y=0;y<100;y++){ System.out.println(“x=”+x+”; y=”+y); if (y==10) { << 设有以下程序段 int x=0,s=0; while(!x!=0) s+=++x; printf("%d",s); 则 。 设有以下程序段 ,则 _____。 int x=0,s=0; while(!x!=0) s+=++x; printf("%d",s); 设有以下函数:includeintf(inta){intb=0,c;c=3;b++;c++;return(a+b+c);}如果在下面的程序中调用该函数,则输出结果是__.voidmain{inti;for(i=0;i<3;i++)printf(%d ,f(i));}() 设有以下函数 void fun(int n,char * s) {……} 则下面对函数指针的定义和赋值均是正确的是() 函数y=0既是奇函数又是偶函数.() 以下程序的输出结果是()。int f(){static int i=0; int s=1; s+=i; i++; return s;} main() {int i,a=0; for(i=0; i 设有一个递归算法如下:intfun(intn){if(n0)需要调用该函数的次数为() 当x→0时,以下函数是无穷小量的是()。 下列函数中,在点(0,0)处连续的函数是( )。 设有以下程序class Test{ Test(int i) { System.out.println(“Test(” +i +”)”); }}public class Q12 { static Test t1 = new Test(1); Test t2 = new Test(2); static Test t3 = new Test(3); public static void main(Str (32)设有如下函数定义 设有以下函数过程:Function fun(m As Integer)As IntegerDim k As Integer, sum As Integersum=0For k=m To 1 Step-2sum=sum+kNext kfun=stlmEnd Function若在程序中用语句s=fun(10)调用此函数,则s的值为()。 设函数f(x)在(-∞,+∞)上是奇函数,在(0,+∞)内有f"(x)<0, f""(x)>0,则在(-∞,0)内必有: 有以下函数 int fun(char *x,char *y) ( int n=0; while((*x=*y)&&*x!=’\0’){x++;y++;n++;} return n; } 函数的功能是 设有定义inx=0,*p;,立即执行以下语句,正确的语句是() 以下程序的输出结果为( )。 public class Main {public static void main(String[] args) { int i=0, j=0, a=6; if((++i>0)||(++j>0)) a++; System. out. println( "i=" +i+", j ="+j+", a="+A) ;} }
购买搜题卡 会员须知 | 联系客服
会员须知 | 联系客服
关注公众号,回复验证码
享30次免费查看答案
微信扫码关注 立即领取
恭喜获得奖励,快去免费查看答案吧~
去查看答案
全站题库适用,可用于E考试网网站及系列App

    只用于搜题看答案,不支持试卷、题库练习 ,下载APP还可体验拍照搜题和语音搜索

    支付方式

     

     

     
    安全验证

    点击更换

    确定