-
以下程序的输出结果是( ) #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>iht b=2;int funC (int*a) { b+=*a;return(b);}void m
下列程序的输出结果是 inClUde<iostream.h> iht b=2; int funC (int*a) { b+=*a;return(b);} void main() { inta=2,res=2; res+=func(&a); cout<<res;}
A.4
B.6
C.8
D.10
-
下面程序的运行结果是()。 include<iostream.h
A.12 12
B.12 21
C.21 12
D.21 21
-
以下程序段的输出结果是[ ]。 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> 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>int rain(iltl a,int B.{if(a<B.return a;el
下列程序的输出结果是()。
include<iostream.h>
int rain(iltl a,int B.
{
if(a<B.return a;
else retum b;
retum 0;
}
void main
{
eout<<min(1,min(2,3))<<endl;
}
A.0
B.1
C.2
D.3
-
阅读以下程序,写出程序运行后的输出结果是 ______。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> 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; int main() { ch
运行程序,程序输出结果是(). include <iostream> using namespace std; int main() { char str[100]="program",*p=str; str[3]=0; cout<
< <endl; return> A、ogram
B、r
C、o
D、pro
</endl;>
-
下面程序的运行结果是【】。 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>using namespace std;void add(){static int x;x++;c
下面的程序输出结果是()。 include<iostream> using namespace std; void add() { static int x; x++; cout<<x<<''; } int main() { for(int i=0;i<3;i++) add(); return 0; }
A.111
B.123
C.222
D.333
-
下列程序的输出结果是()。include< iostream.h> void main(){double d=3.2;intx,y:x=1.2;y=(x+3.
下列程序的输出结果是()。 include< iostream.h> void main() {double d=3.2; intx, y: x=1.2; y=(x+3.8)/5.0 cout<<y*d <<endl;}
A.3
B.3.2
C.0
D.3.07
-
下面程序的运行结果为()。 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>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 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> 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