-
以下程序的输出结果是( ) #include iostream.h #include string.h void main() { char *p[10]={abc,aabdfg,dcdbe,abbd,cd}; cout<
-
以下程序的输出结果是()。include <iostream.h>void main(){int a=0,i;for(i=1 ;i<5;i++){ switc
以下程序的输出结果是()。include <iostream.h>void main(){ int a=0,i; for(i=1 ;i<5;i++) { switch(i) { case 0: case 3: a+ =2; case 1: case 2: a+ =3; default: a+ =5; } } cout<<a<<end1; return;}
A.31
B.13
C.10
D.20
-
有如下程序:include<iostream.h>long fib(int n){if(n>2)return(fib(n-1)+fib(n-2)); else retu
有如下程序: include<iostream.h> long fib(int n) { if(n>2)return(fib(n-1)+fib(n-2)); else return(2);} void main() {cout<<fib(3);} 该程序的输出结果是
A.2
B.4
C.6
D.8
-
下面程序的运行结果为#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> floa()
A.编译出错
B.9
C.21
D.9.0
-
以下程序段的输出结果是[ ]。 include<iostream.h> void ref(int &i); void main(){int val=1
以下程序段的输出结果是 [ ] 。
include<iostream.h>
void ref(int &i);
void main(){
int val=1;
cout<<“旧值:”<<val<<end1;
ref(val);
cout<<”新值:”<<val<<end1;
}
void ref(int &i){i=10;}
-
以下程序的输出结果是【】。 include<iostream.h> int add(int x,int y) { retum X+y; } dOuble ad
以下程序的输出结果是【 】。
include<iostream.h>
int add(int x,int y)
{
retum X+y;
}
dOuble add(dOUble x,double y)
{
return x+y;
}
void main()
{
int a=4,b=6;
double c=2.6,d=7.4;
cout<<add(a,b)<<",”<<add(C,d)<<endl;
}
-
以下程序段的执行结果为()。include< iostream.h>definePLUS(x,y)x+yvoid main (){int x=1,y=2,
以下程序段的执行结果为()。 include< iostream.h> definePLUS(x,y) x+y void main () {int x=1,y=2,Z=3,sum: sum=PLUS (x+y,Z) * PLUS (y,Z): cout<<"SUM="<<sum; cout<<endl:}
A.SUM=9
B.SUM=12
C.SUM=18
D.SUM=30
-
有以下程序include<iostream,h>int i=0;void fun(){{ Static int i=1 Std::cont<<i++<<','; } S
有以下程序 include<iostream,h> int i=0; void fun() { { Static int i=1 Std::cont<<i++<<','; } Std::cout<<i<<','; } int main() { fun();fun(); return 0; } 程序执行后的输出结果是()。
A.1,2,1,2,
B.1,2,2,3,
C.2,0,3,0,
D.1,0,2,0,
-
以下程序的正确运行结果是()。include<iostream.h>int f(int);void main(){int a=2,i;for(i=0;i<
以下程序的正确运行结果是()。 include<iostream.h> int f(int); void main() { int a=2,i; for(i=0;i<3;i++)cout<<f(a)<<" "; cout<<endl; } int f(int a) { int b=0 static int c=3; b++:c++; return(a+b+c); }
A.777
B.7 10 13
C.79 11
D.7 8 9
-
有如下程序include<iostream.h>int func(int a,int b){ return(a+b) ;}void main(){ int x=2,y
有如下程序 include<iostream.h> int func(int a,int b) { return(a+b) ;} void main() { int x=2,y=5,z=8, r; r=func (func(x,y),z); cout << r; } 该程序的输出的结果是
A.12
B.13
C.14
D.15
-
阅读以下程序,写出程序运行后的输出结果是 ______。include<iostream.h>void main(){char a[]={'
阅读以下程序,写出程序运行后的输出结果是 ______。 include<iostream.h> void main(){ char a[]={'H','e','1','1','o','\0'}; int i,j; i=sizeof(a)/sizeof(char); j=strlen(a) cout<<i<<‘ ’<<j;
A.6 6
B.5 6
C.1 5
D.6 5
-
以下程序的输出结果是 ______。include<iostream.h>void main() {char w[][10]={ "ABC", "DEFGH"
以下程序的输出结果是 ______。 include<iostream.h> void main() { char w[][10]={ "ABC", "DEFGH", "IJKL" , "MNOP" }; int k; for (k=1 ;k<3 ;k++) cout<<w[k]<< " " }
A.ABC FGH KL
B.ABC EFG IJ M
C.EFG JK 0
D.DEFGH IJKL
-
以下程序的输出结果是()。include<iostream.h>void main(){int i, j,x=0;fof (i=0;i<2;i++={x++;
以下程序的输出结果是()。 include<iostream.h> void main() {int i, j,x=0; fof (i=0;i<2;i++= {x++; for(j=0;j<3;j++= {if(j%2)continue: x++; x++;} cout<<"x="<<x;=
A.x=4
B.x=8
C.x=6
D.x=12
-
下列程序的输出结果为()。 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.h>void main(){ int x=5,y=2; cout<<!(y==x/2)<<","; cout<<y!=x%
有以下程序: include<iostream.h> void main() { int x=5,y=2; cout<<!(y==x/2)<<","; cout<<y!=x%3)<<","; cout<<(x>0&&y<0)<<","; cout<<(x!=y‖x>=y)<<endl: } 程序执行后的输出结果是()
A.0,0,0,1
B.1,1,1 1
C.0,0, 1,1
D.1,1,0,0
-
有以下程序 include<iostream.h> floatfun(int x,int y) {return(x+y);}void main() {int a=2,b
有以下程序 include<iostream.h> floatfun(int x,int y) {return(x+y);} void main() {int a=2,b=5,c=8; tout<<fun((int)fun(a+c,b),a-C);} 程序运行后的输出结果是
A.编译出错
B.9
C.21
D.9
-
下面程序的运行结果为()。 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>float fun(int x,int y){return(x+y);}void main(){int a=2,b=5,
有以下程序 include<iostream.h> float fun(int x,int y) {return(x+y);} void main() {int a=2,b=5,c=8; cout<<fun((int)fun(a+c,b),a-c);} 程序运行后的输出结果是()。
A.编译出错
B.9
C.21
D.9
-
若运行时给变量x输入12,则以下程序的运行结果是include <iostream.h>void main(){ int x,y; cin
若运行时给变量x输入12,则以下程序的运行结果是 include <iostream.h> void main() { int x,y; cin>>x; y=x>12? x+10:x-12; cout<<y; cout<<endl; }
A.0
B.22
C.12
D.10
-
以下程序的执行结果为()。include<iostream.h>Class sample{ int n;public: sample(int i){n=i;}
以下程序的执行结果为()。 include<iostream.h> Class sample { int n; public: sample(int i){n=i; } operator ++() { n++; } void display() {cout<<n<<end1; } }; void main() { sample obj(5); obj++;
A.5
B.6
C.7
D.8
-
有以下程序include"iostream.h"void main(){inti=l,j=1,k=2;if ((j++{}k++)&&i++)cout<
有以下程序 include"iostream.h" void main() { inti=l,j=1,k=2; if ((j++{}k++)&&i++) cout<< i << " ," << j << "," << k; cout<<endl; 执行后输出结果是
A.1,1,2
B.2,2,1
C.2,2,2
D.2,2,3
-
以下程序的输出结果是 ______。include<iostream.h>void main(){ inti,j;for(j=10;j<=11;j++){fo
以下程序的输出结果是 ______。 include<iostream.h> void main(){ int i,j; for(j=10;j<=11;j++){ for(i=9;i<j:j++) if(!(j%i))break; if(i>j-1)cout<<j<<" " ; } }
A.11
B.10
C.10 11
D.9
-
下列程序的输出结果为()。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