给出以下代码,该程序的运行结果是()class Example {public static void main (String args[])
A.-1
B.Exception
C.1
D.0
A.-1
B.Exception
C.1
D.0
编写如下代码:
运行上面的程序,单击命令按钮,其输出结果是
A.9885
B.5889
C.988
D.889
A.20
B.30
C.10
D.0
阅读下列代码:该代码的运行结果是()。
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出零
D.输出空
有以下程序: #include<iostream.h> void main() { int x=10,y=10; for(int i=0;x>8;y=++i) cout<<x--<<","<<y<<","; } 该程序运行后的输出结果是()。
A.10,1,9,2
B.9,8,7,6
C.10,9,9,0
D.10,10,9,1
若有以下程序: #include<iostream> using namespace std; class TestClass { public: void who(){cout<<"TestClass"<<endl;} }; class TestClass1:public TestClass { public: void who(){cout<<"TestClass1"<<endl;} }; int main() { TestClass *p; TestClass1 obj1; P=&obj1; P->who(); return 0; 则该程序运行后的输出结果是()。
A.TestClass1
B.TestClass
C.0
D.无输出
阅读以下说明和C++代码。
[说明]
已知类SubClass的getSum方法返回其父类成员与类SubClass成员j的和,类 SuperClass中的getSum为纯虚拟函数。程序中的第23行有错误,请修改该错误并给出修改后的完整结果,然后完善程序中的空缺,分析程序运行到第15行且尚未执行第15行的语句时成员变量j的值,最后给出程序运行后的输出结果。
[C++代码]
A. 1,2,3
B. 1,2,3,4
C. 2,3,4
D. 2,3,4,5
有如下函数过程: FunctiOngyS(By Val X As Integer,ByValy As Integer)As Integer DOWhiley<>0 reminder=x Mody X=y y=reminder Loop gys=x End FunctiOn 以下是调用函数的事件过程,该程序的运行结果是,()。 PriVate Sub Command7_Click() Dim
A.0
B.25
C.50
D.100
若有以下程序: #include <iostream> using namespace std; class Base public: Base() { x=0; } int x; }; class Derivedl: virtual public Base public: Derived1() { x=10; } }; class Derived2: virtual public Base publici Derived2() x=20; }; class Derived :public Derived1,protected Derived2 {}; int main() Derived obj; cout<<obj.x<<end1; return 0; } 该程序运行后的输出结果是
A.20
B.30
C.10
D.0
已知字符A的ASCⅡ代码值为65,以下程序运行时若从键盘输入:B33<回车>.则输出结果是()。
include
main()
{ char a,b;
a=getchar();scanf("%d",&B);
a=a-'A'+'0';b=b*2;
printf("%c%c\n",a,B);
}