-
以下程序的输出结果是( ) #include iostream.h #include string.h void main() { char *p[10]={abc,aabdfg,dcdbe,abbd,cd}; cout<
-
有如下程序: inClude<iostream> using namespaCe std: Class CD{ publiC: ~CD{Cout<<’C’:} private: Char name[80]; }; int main{ CD a,*b,d[2]; return 0; 执行这个程序的输出结果是()。
A.CCCC
B.CCC
C.CC
D.C
-
有如下程序: include<iostream> includediomanip> usingnamespacestd; intmain(){ ints[]={123,234); cout<<setfill(*)<<setw(6); for(inti=0;i<2;i++){cout<<s[i]<<endl;) return0; } 运行时的输出结果是()。
A.123
B.***123 234234
C.***123
D.***123 ***234234***
-
以下程序的输出结果是()。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>void fun(int*x,int*y){cout<<*x<<*y;*X=3;*y=4;}vo
下列程序段的输出结果是 include<iostream.h> void fun(int*x,int*y) {cout<<*x<<*y; *X=3; *y=4; } void main() {int x=1,y=2; fun(&y,&x); cout<<X<<y<<endl; }
A.2143
B.1212
C.1234
D.2112
-
下列程序的输出结果是 include<iostream.h> int b=2; int func(int *a) {b+=*a;return(b) ;} void main() { int a=2,res=2; res+=func(&a) ; cout<<res;}
A.4
B.6
C.8
D.10
-
以下程序段的输出结果是[ ]。 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>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>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; 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 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>void count(int x[],int n,int &y
在下面程序运行后,输出结果为 ______。 include<iostream.h> void count(int x[],int n,int &y){ int k; y=0; for(k=0:k<n;k++) if(x[k]<0) y++; } void main(){ int b[]={2,1,-8,-3,7,2,4,6,0,-13}; int x; count(b,10,x); cout<<“x”<<x<<end1; }
A.x=3
B.x=5
C.出错
D.x=0
-
下面程序的输出结果是 ______。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>main(){int a=4,b=3,c=1,d;d=a&&b&&am
下列程序的输出结果为()。 include<iostream.h> main() { int a=4,b=3,c=1,d; d=a&&b&&b>c-!0; cout<<d; }
A.0
B.3
C.1
D.4
-
以下程序的输出结果是 ______。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
-
下列程序的输出结果是 。 using namespce std; include <iostream> int main() { int x=1,i=1; for (; x < 50; i++) { if(x >= 10) break; if(x % 2 != 0){ x += 3; continue; } x-=-1; } cout<<x<<'
B、11 6
C、12 6
D、11 7