下面程序的结果为 include<iostream.h> int c; class A { private: int a; static int b; public: A() {a=0;c=0;} void seta(){a++;} void setb(){b++;}
A.1 2 1
B.1 2 2
C.1 1 2
D.2 2 2
时间:2023-03-18 16:14:44
相似题目
-
下面程序的运行结果为include<iostream.h>void swap(int &a, int b){int temp;temp=a++;a=b;b=temp;}void main()int a=2,b=3;swap(a, b) ;cout < < a < <"," < < b < < endl;}
A.2,3
B.3,2
C.2,2
D.3,3
-
下面程序的运行结果是include<iostream.h>void main(){int num=1;int &ref=num;ref=ref+2;c
下面程序的运行结果是 include<iostream.h> void main() { int num=1; int &ref=num; ref=ref+2; cout<<num; num=num+3; cout<<ref<<end1; }
A.13
B.16
C.36
D.33
-
下面程序的运行结果为#include<iostream.h>void main( )char a='3';switch(
A.
 
-
下面程序的运行结果是()。 include<iostream.h
A.12 12
B.12 21
C.21 12
D.21 21
-
下面程序的运行结果为()。 include<iostream.h> void swap(int &a,int B) { int temp; temp=a++; a=b; b=temp; } void main() { int a=2,b=3; swap(a,b); cout<<a<<“,”<<b<<end1; }
A.2,3
B.3,2
C.2,2
D.3,3
-
下面程序的运行结果是include"iostream.h"define sum(a,b)a*bvoid main(){int x;X=sum(1+2,3);
下面程序的运行结果是 include"iostream.h" define sum(a,b)a*b void main() {int x; X=sum(1+2,3); cout<<x; }
A.0
B.9
C.7
D.5
-
下面程序的运行结果是()。include<iostream.h> void main{int num=1:int&ref=num; ref
下面程序的运行结果是()。
include<iostream.h> void main
{
int num=1:
int&ref=num; ref=ref+2:
cout<<num: num=num+3: cout<<ref<<endl:
}
A.13
B.16
C.36
D.33
-
下面程序的运行结果是()。 include<iostream.h> void fun(int *a,int *B. { int x=*a
下面程序的运行结果是()。 include<iostream.h> void fun(int *a,int *B. { int x=*a: *a=*b;*b=X; cout<<*a<<*b<<””: void main { int X=1,Y=2; fun(&x,&y); cout<<x<<Y<<endl; }
A.12 12
B.12 21
C.21 12
D.21 21
-
下面程序的结果为()。include<iostream.h>void change(int a,int b){int temp;temp=a;a=b;b=temp
下面程序的结果为()。 include<iostream.h> void change(int a,int b) { int temp; temp=a; a=b; b=temp; } void main() { int m,n; m=8; n=9; change(m,n); cout<<m<<""<<n<<endl; }
A.89
B.98
C.程序有错误
D.99
-
下面程序的输出结果是include<iostream.h>class example{ int a;public: example(int b){a=b++;
下面程序的输出结果是 include<iostream.h> class example { int a; public: example(int b){a=b++;} void print(){a=a+1; cout<<a<<" ";} void print()const{cout<<a<<" ";} }; void main() { example x(3); const example y(2); x.print(); y.print(); }
A.2 2
B.4 3
C.4 2
D.3 2
-
下列程序的输出结果为()。 include<iostream.h> void main { char*a[]={”hell0”,”the”,”
下列程序的输出结果为()。 include<iostream.h> void main { char*a[]={”hell0”,”the”,”world”}; char** pa = a: pa++; cout<<*pa<<endl: }
A.hello
B.the
C.world
D.hellotheworld
-
以下程序的输出结果是 。 include <iostream> include <iomanip> using namespace
以下程序的输出结果是 。 include <iostream> include <iomanip> using namespace std; void main() { int i; for (i=1;i>=0;) cout< <i--;>
-
下面程序的运行结果是【】。 include<iostream> using namespace std; void fun(int&a,int b=3)
下面程序的运行结果是【 】。
include <iostream>
using namespace std;
void fun(int &a, int b=3)
{
static int i=2;
a = a + b + i;
i = i + a;
}
int main()
{
int x=5, y=2;
fun(x, y);
cout<<x<<",";
fun(x);
cout<<x<<end1;
return 0;
}
-
下面程序的运行结果为 include<iostream.h> void main() { for(int a=0,x=0;! x&&a<=10;a++) { a++; } cout<<a<<end1; }
A.10
B.11
C.12
D.0
-
下面程序的运行结果是include<iostream.h>void main(){int i=1;while(i<=8)if (i%3!=2)cont
下面程序的运行结果是 include<iostream.h> void main() { int i=1; while(i<=8) if (i%3!=2)continue; else cout<<i; }
A.25
B.36
C.258
D.369
-
下面程序的运行结果为()。 include<iostream.h> voidmain() { chara=3: switch(a) {
下面程序的运行结果为()。 include<iostream.h> voidmain() { chara=3: switch(a) { case3:cout<<"3"; case2:cout<<"2";break; default:cout<<"1"; } }
A.3
B.321
C.31
D.32
-
下列程序的运行结果为()。 include<iostream.h> void main { int a=2: int b=a+1: co
下列程序的运行结果为()。 include<iostream.h> void main { int a=2: int b=a+1: cout<<a/b<<endl:
A.0.66667
B.0
C.0.7
D.0.66666666…
-
下面程序的输出结果是 ______。include<iostream.h>voidmain(){intx=20;int&y=x;cout<<(x==y
下面程序的输出结果是 ______。 include<iostream.h> void main(){ int x=20; int &y=x; cout<<(x==y)<<“”; cout<<(&x==&y)<<end1: }
A.20 20 20 20
B.20 20
C.1 1
D.出错
-
下面程序的运行结果是()。 include<iostream.h> int fun(int a[],int n) { int resuh=1
下面程序的运行结果是()。 include<iostream.h> int fun(int a[],int n) { int resuh=1; for(inl i=1;i<11;1‘++) result=result * a[i]; retum result; } void main int a[3]={3,4,5}: cout<<fun(a,3)<<endl: }
A.12
B.15
C.20
D.60
-
下面程序的运行结果为include<iostream,h>Void swap(int &a,int b){int temp;temp=a++;a=b;
下面程序的运行结果为 include<iostream,h> Void swap(int &a,int b) { int temp; temp=a++; a=b; b=temp; } void main() { int a=2,b=3; swap(a,b); cout <<a <<”,” <<b <<end1 }
A.2,3
B.3,2
C.2,2
D.3,3
-
下面程序的运行结果是include<iostream.h>Void main(){int num=1;int &ref=num;ref=ref+2;cout < < num;num=num+3;cout < < ref < <endl;}
A.13
B.16
C.36
D.33
-
下面程序段的运行结果是 include<iostream.h> void main() {char*s="abcde"; S+=2;
下面程序段的运行结果是 include<iostream.h> void main() { char*s="abcde"; S+=2; cout<<&s;}
A.cde
B.字符'c'
C.字符'c'的地址
D.无确定的输出结果
-
下列程序的输出结果为()。include<iostream.h) int ...
下列程序的输出结果为()。
include<iostream.h) int fune(int n)
{
if(n<1)return l;
else return n+time(n一1); return 0;
}
void main {
cout<<func(5)<<endl;
}
A.0
B.10
C.15
D.16
-
下列程序的输出结果为()。 include<iostream.h)
A.0
B.10
C.15
D.16