A.600
B.720
C.760
D.800
第1题
以下程序的输出结果是______。
include<iostream.h>
int add(int x, int y)
{
return x+y;
}
double add(double x, double y)
{
return x+y;
}
void main()
{
int a=3, b=3;
double c=6.5, d=1.5;
cout<<add(a, b)<<","<<add(c, d)<<end1;
}
第2题
下面程序的输出结果是【 】。
include<iostream.h>
int add(int a, int b);
void main()
{
extern int x, y;
cout<<add(x, y)<<end1;
}
int x(20),y(5);
int add(int a, int b)
{
int s=a+ b;
return s;
}
第3题
下列程序的输出结果是______。
include<iostream.h>
class base
{
int x,y;
public:
base(int i,int j){x=i;y=j;}
virtual int add(){return x+y;}
};
class three:public base
{
int z;
public:
three(int i,int j,int k):base(i,j){z=k;)
int add(){return(base::add()+z);}
};
void main()
{
three*q=new three(10,20,30);
cout<<q->add()<<endl;
}
第4题
以下程序输出结果是 ______。 #include<iostream.h> void fun(int x,int y,int z){z=x+y;} void main() { int a=10; fun (2,2,a); cout<<a; }
A.0
B.4
C.10
D.无定值
第5题
以下程序运行后的输出结果是【 】。
include<iostream.h>
void fun(int x,int y)
{ x=x+y;y=x-y;x=x-y;
cout<< x << "," <<y << " ,";}
void main()
{ int x=2,y=3;fun(x,y);
cout<< x << "," << y << endl;}
第6题
以下程序的输出结果是 #include<iostream.h> void main() { int x=1,y=3; cout << x++ << " , "; { int x=0;X+=y*2; cout<<x<<" ,"<<y<<" ;"; } cout<<x<<" ,"<<y; }
A.1,6,3,1,3
B.1,6,3,6,3
C.1,6,3,2,3
D.1,7,3,2,3
第7题
以下程序的输出结果是 #include<iostream.h> void main() {int x=1,y=3; cout << x++ << ","; {int x=0;x+=y*2; cout <<X <<"," <<y << ","; } cout << x <<","<< y; }
A.1,6,3,1,3
B.1,6,3,6,3
C.1,6,3,2,3
D.1,7,3,2,3
第8题
以下程序的输出的结果是()。 #include<iostream.h> int x=3: void main() { void fun(); int i; for(i=1;i<x;i++) fun(); } void fun() { static int x=1; x*=x+1; cout<<x<<" "; }
A.3,3
B.2,2
C.2,6
D.2,5
第9题
以下程序的输出的结果是()。#include <iostream.h>int x=3;void main(){ void incre(); int i; for (i=1;i<x;i++) incre();}Void incre(){ static int x=1; x*=x+1; cout<<x<<"";}
A.3 3
B.2 2
C.2 6
D.2 5
第10题
以下程序输出结果是(): #include<iostream> using namespace std; void add(int X,int y,int *z) { *z=y+x; } int main() { int a,b,c; add(8,4,&a); add(6,a,&b); add(a,b,&c); cout<<a<<","<<b<<","<<c<<end1; return 0;
A.12,10,14
B.12,18,30
C.12,6,18
D.12,14,30
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!