1、读下面的程序,写出输出结果include <iostream> using namespace std; class A { public: A(int i) {cout<<"constructing A "<<i<<endl;} }; class B { public: B(int j) {cout<<"constructing B "<<j<<endl;} }; class C: public A, public B { public: C(int a, int b, int c, int d): A(a), mB(d), mA(c),B(b) { } private: B mB; A mA; }; int main() { C obj(1,2,3,4); return 0; }
相似题目
-
写出程序的运行结果。 #include <stdio.h> main() { inta,b; scanf(”%d%d",&a,&b); if(++a>=b) printf(”Yes”); printf("a+b=%d\n",a+b); } 如果输入:a=6,b=8,则输出结果是()。
-
当执行下面的程序时,如果输入ABC,则输出结果是()。 #include "stdio.h" #include "string.h" main() { char ss[10]="12345"; gets(ss); strcat(ss,"6789"); printf("%s\n",ss); }
-
写出以下程序运行后的输出结果。 #includestdio.h #include string.h int main() { char st[20]={hello\0\t\\\}; printf(%d,%d\n,strlen(st),sizeof(st)); return 0; }
-
以下程序的输出结果是 。 #include main() { int m[ ]={1,4,7}; int i; for(i=1;i<=2;i++) printf(%d,m[i]); }
-
有以下程序#include #include main(){ char str[ ][20]={“One*World”, “One*Dream!”},*p=str[1];printf(“%d,”,strlen(p));printf(“%s ”,p);}程序运行后的输出结果是( )
-
写出以下程序的输出结果 ( ) 。 #include \stdio.h\ int i; int fun( int a, int *b); int main() { int i=1,j=2; fun (fun(i,&j),&j); return 0; } int fun ( int a, int *b) { static int m=2; i+=m+a; m =++(*b); printf (\%d,%d,\,i,m); return (m); }
-
有下列程序,程序运行后的输出结果是0( )。#include int main( ){int a[5]={1,2,3};printf(\%d \,a[3]);return 0;}
-
以下程序的输出结果是(44)。 include""void main(){ printf("%d\n",NULL);}A.不确定的值B.0C.-1
-
读下面的:includevoid main(){static int a[]={1,2,3,4,5};int *p=a;printf();printf();}写出运行的结果、
-
以下程序段的输出结果是[ ]。 include<iostream.h> void ref(int &i); void main(){int val=1
-
下列程序的输出结果是______。 include<stdio.h> main() { int a=2,b=-1,C=2;
-
要求下面的程序运行后,显示如下结果: 2 10 4 6 1 5 2 3 2 4 7 8 5 1 3 2 下列程序执行后的输出结果是________。 include void main(); }
-
下列程序的输出结果是()。 include<stdio.h> main() { int i,S=0; for(i=1;i<10;i++)
-
下列程序的输出结果是()。 include<stdio.h> main { int i; for(i=1;i<=10,i++) { if(
-
阅读以下程序,写出程序运行后的输出结果是 ______。include<iostream.h>void main(){char a[]={'
-
◑有以下程序◑include◑include◑main( )◑{char x[]=“STRING”;◑x[0]=0;x[1]=’\0’;x[2]=’0’;◑printf(”%d%d\n”,sizeof(x),strlen(x));◑}◑程序运行后的输出结果是( )。◑6 1◑7 0◑6 3◑7 1
-
写出下面程序执行后的运行结果。 include <stdio.h> define N 2 define M N+1 define N
-
以下程序的输出结果是() include<stdio.h> main() { int a,b; for(a=1,b=1,a<=50;a+ +)
-
下面的程序输出结果是()。include<iostream>using namespace std;void add(){static int x;x++;c
-
【简答题】分析下面的程序,写出程序的运行结果。 include <stdio.h> int main() { char c1='a',c2='b',c3='c',c4='110',c5; c5=c4+1; printf("a%c b%c c%ctabcn",c1,c2,c3); printf("%c %cn",c4,c5); return 0; }
-
写出程序的运行结果的第二行输出: 。 include <stdio.h> int main() { int X[4][4]={{11,2
-
阅读下面的C语言程序,请给出正确的输出结果()。include<stdio.h>define N 10define s(x) x*xdefine f(x) (x*x)define g(x) ((x)*(x))main(){ int i1, i2, i3, i4; i1=1000/s(N); i2=1000/f(N);i3=f(N+1);i4=g(N+1);printf(“i
-
运行程序输入hello↙和world↙,写出输出结果。 include <stdio.h>
-
有以下程序include <stdio.h>main){ ina=-1b=-1;for(a;)++b;printf("%d,%"ab);}程序运行后的输出结果是()
推荐题目
- 以下描述正确的是()
- dn值大的滚动轴承应采用()润滑,而dn值小的滚动轴承可采用()润滑。
- 巨乳缩小术乳头乳晕定位包括().
- 巡视工作领导小组根据巡视组的建议,研究提出处理意见,报同级纪检机关决定。
- 关于医院内获得性肺炎的特点,错误的是()。
- 企业的灵魂是()
- 查询一个表的总的记录条数,可以采用()统计函数。
- 下列选项中不属于强力型企业文化特点的是()
- 记账凭证的基本内容不包括所附原始凭证的张数。
- ①以知识为主导所得出的美丑的概念,是不真实的,也是没有意义的。②即如美丑而言,当天下人知道追求美的时候,就有了美丑的区分,就有了分别的见解。③在老子看来,相反相成,是知识构成的特性,但并非世界本身所具有。④老子并非反对人们追求美,但他认为这种追求美的方式,并不能得到真正的美。⑤人为世界分出高下美丑,是在下判断,以人的理性确定世界的意义,这样的知识并不符 合世界的特性。将以上5个句子重新排列,语序正