首页 > 建设工程> 二级建造师
题目内容 (请给出正确答案)
[主观题]

写出以下程序的运行结果。#include int fun(int a){int b=0;static int c=3;b ; c ;return(a

写出以下程序的运行结果。#include int fun(int a){int b=0;static int c=3;b ; c ;return(a

写出以下程序的运行结果。

#include int fun(int a){int b=0;static int c=3;b ; c ;return(a b c);}

main(){int i, a=5;for (i=0; i<3; i )cout<< i<< " "<< fun(a)<< " ";}

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“写出以下程序的运行结果。#include int fun(i…”相关的问题
第1题
写出下列程序的运行结果。#include void Fun(){int num=20;cout<< "The Fun's num i
写出下列程序的运行结果。#include void Fun(){int num=20;cout<< "The Fun's num i

写出下列程序的运行结果。

#include void Fun(){int num=20;cout<< "The Fun's num is"<< num<< endl;

}void main(){int num=10;cout<< "The main's num is "<< num<< endl;Fun();{int num=30;

cout<< "The Field's num is "<< num<< endl;}cout<< "The main's num is "<< num<< endl;}

点击查看答案
第2题
有以下程序: #include<stdio.h> void func(int n) { int i; for(i=0;i<=n;i++)prin

有以下程序: #include<stdio.h> void func(int n) { int i; for(i=0;i<=n;i++)printf("*"): printf("#"); } main() {func(3);printf("????");func(4);printf("n\"); 程序运行后的输出结果()。

A.****#????***#

B.***#????****#

C.**#????****#

D.****#????*****#

点击查看答案
第3题
有以下程序#include <stdio.h>#define PT 3.5 ;#define S(x) PT*x*x ;main(){ int a=

有以下程序

#include <stdio.h>

#define PT 3.5 ;

#define S(x) PT*x*x ;

main()

{ int a=1, b=2; printf("%4.1f\n",S(a+b));}

程序运行后的输出结果是

A)14.0

B)31.5

C)7.5

D) 程序有错无输出结果

点击查看答案
第4题
请写出下列程序的输出结果。()#includeint main() /{char str[ ]="1A2B3C4D"; int i;

请写出下列程序的输出结果。()

#include

int main() /{

char str[ ]="1A2B3C4D"; int i;

for(i=0;str[i]!='/0';i++)

if ((str[i]<'0') || (str[i]>'9'))

printf("%c",str[i]);

return 0;

/}

}

点击查看答案
第5题
请写出如下程序的输出结果:#include class R{public:R(int r1,int r2) {R1=r1;R2=r2;}void p
请写出如下程序的输出结果:#include class R{public:R(int r1,int r2) {R1=r1;R2=r2;}void p

请写出如下程序的输出结果:

#include class R{public:R(int r1,int r2) {R1=r1;R2=r2;}void print();

void print() const;private:int R1,R2;};void R::print(){cout<< R1<< ":"<< R2<< endl;

}void R::print() const{cout<< R1<< ";"<< R2<< endl;}void main(){R a(5,4);a.print();

const R b(20,52);b.print();}

点击查看答案
第6题
写出以下程序的运行结果

class A

{

int a;

A(int b)

{a=b;}

void show()

{System.out.println(“a=”+a);}

}

public class Class1

{

public static void main (String args[])

{

A bj=new A(12345);

boolean b=false;

char ch=97;

obj.show();

System.out.println(“b=”+b+”/tch=”+ch);

}

}

点击查看答案
第7题
下面程序的运行结果为()。#include <iostream>using namespace std;void main() { for(int a =0

下面程序的运行结果为()。 #include <iostream> using namespace std; void main() { for(int a =0,x =0; !x&&a < =10; a ++ ); cout << a << endl;

A.0

B.1

C.10

D.11

点击查看答案
第8题
下面程序的运行结果为()。#include<iostream.h>class A{int numpublic:A(int i){num=i;}A(A&a

下面程序的运行结果为()。 #include<iostream.h> class A { int num public: A(int i){num=i;} A(A&a){Bum=a.num++;} void print(){cout<<Bum;} }; void main() { A a(1),b(a); A. print(); B.print(); }

A.11

B.12

C.21

D.22

点击查看答案
第9题
编写函数fun(),它的功能是;根据以下公式求p的值,结果由函数值带回。m与n为两个正数且要求m>n。P=m!

编写函数fun(),它的功能是;根据以下公式求p的值,结果由函数值带回。m与n为两个正数且要求m>n。

P=m!/n!(m-n)!),例如:m=12,n=8时,运行结果为495.000000。

注意:部分源程序给出如下。

请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。

试题程序:

include <conio.h>

include <stdio.h>

float fun (int m, int n)

{

}

main()

{

clrscr() ;

printf ("p=%f\n", fun (12,8) ) ;

}

点击查看答案
第10题
分析并写出下面程序的运行结果

点击查看答案
退出 登录/注册
发送账号至手机
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改