下面程序的输出是( )。
main( )
int t=1;fun(fun(t));
fun(int h)
static int a[3]=1,2,3;
int k;
for(k=0;k<3;k++)a[k]+=a[k]-h;
for(k=0;k<3;k++)printf("%d",a[k]);
printf("/n");
return(a[h]);
A:1,2,3, B:1,5,9, C:1,3,5, D:1,3,5, E:1,3,5, F:0,4,8, G:1,3,5, H:-1,3,7,
有以下程序:
void f(int V,int w)
int t;
t=v;v=w;w=t;
void main( )
int x=0,y=0,z=0;
scanf("%d,%d,%d",&x,&y,&z);
if(x>y) f(x,y);
else if(y>z) f(y,z);
else f(x,z);
printf("%d,%d,%d/n",x,y,z);
如果输入1,2,3输出结果为1,2,3,如果输入3,1,2执行后输出结果是( )。
A:1,2,3 B:3,1,2 C:1,3,2 D:2,3,1
下面程序的输出是( )。
main( )
int t=1;fun(fun(t));
fun(int h)
static int a[3]=1,2,3;
int k;
for(k=0;k<3;k++)a[k]+=a[k]-h;
for(k=0;k<3;k++)printf("%d",a[k]);
printf("/n");
return(a[h]);
A:1,2,3,
1,5,9, B:1,3,5,
1,3,5, C:1,3,5,
0,4,8, D:1,3,5,
-1,3,7,
若有以下程序: #include<iostream> using namespace std; class A { private: int a; public: void seta(int x) { a=x; } void showa( ) { cout<<a<<","; } }; class B { private: int b; public: void setb(int x) { b=x; } void showb( ) { cout<<b<<",”; } }; class C://pUblic A,private B { private: int c; public: void setc(int x,int y,int z) { c=z; seta(x); setb(y); } void showc( ) { showa( ); showb( ); cout<<c<<end1; } }; int main( ) { Cc; c.setc(1,2,3); c.showc( ); retrun 0; } 程序执行后的输出结果是
A:1,2,3 B:1,1,1 C:2,2,2 D:3,3,3
若有以下程序:#include <iostream>using namespace std;class A{private: int a;public: void seta(int x) { a=x; } void showa( ) { cout<<a<<","; }};class B{private: int b;public: void setb(int x) { b=x; } void showb( ) { cout<<b<<","; }};class C: public A, private B{private: int c;public: void setc(int x, int y, int z) { c=z; seta(x); setb(y); } void showc( ) { showa( ); showb( ); cout<<c<<end1; }};int main( ){ C c; c.setc(1,2,3); c.showc( ); return 0;}程序执行后的输出结果是( )。
A:1,2,3 B:1,1,1 C:2,2,2 D:3,3,3
若有以下程序: #include <iostream> using namespace std; class A { private: int a; public: void seta(int x) { a=x; } void showa,( ) { cout<<a<<", "; } }; class B { private: int b; public: void setb(int x) { b=x; } void showb ( ) { cout<<b<<", "; } }; class C : public A, private B { private: int c; public: void setc(int x,int y, int z) { c=z; sera (x); seth (y); } void showc( ) { showa( ); showb( ); cout<<c<<end1; } }; int main ( ) { C c; c.setc(1,2,3); c.showc( ); return 0; } 程序执行后的输出结果是( )。
A:1,2,3 B:1,1,1 C:2,2,2 D:3,3,3
若有以下程序: #include <iostream> using namespace std; class A { private: int a; public: void seta(int x) { a=x; } void showa( ) { cout<<a<<","; } }; class B { private: int b; public: void setb (int x) { b=x; } void showb( ) { cout<<b<<","; } }; class C :public A,private B { private: int c; public: void setc(int x, inc y, int z) { c=z; seta (x); setb (y); } void showc( ) { showa ( ); showb ( ); cout<<c<<end1; } }; int main ( ) { C c; c. setc(1,2,3); c.showc( ); return 0; } 程序执行后的输出结果是
A:1,2,3 B:1,1,1 C:2,2,2 D:3,3,3