下列程序的运行结果为【 】。
A="1"
B="2"
A=Val (@A@+Val (@B@B=Val ("12")
If A<>B Then Prink A-B Else Print B-A
(11)阅读下列程序:
Option Base 1
Private Sub Form. Click()
Dim x(3,3)
For j=1 to 3
For k=1 to 3
If j=k then x(j,k)=1
If j<> k then x(j,k)=3
Next k
Next j
Call fun(x())
End Sub
Private Sub fun(a())
For j=l to 3
For k=1 to 3
Print a (j.k);
Next k
Next j
End Sub
运行程序时,输出的结果是【 】
第1题:
下面程序的输出结果为( )。#include<iostream.h>class CStatic{public:CStatic() {val++;}static int val;};int CStatic::val=0;void main(){CStatic cs1;cout<<cs1.val<< "";CStatic cs2;CStatic cs3, cs4;cout<<cs val<<end1;}
A.14
B.24
C.34
D.54
第2题:
有如下程序: #include<iostream> using namespace std; class MyClass{ public: MyClass(int x):val(x) {} void Print() const {cout<<"const:val="<<val<<'\t';} void Print() {cout<<"val="<<val<<'t';} private: int val; }; int main() const MyClass obj1(10); MyClass obi2(20); obj1.Print(); obj2.Print(); return 0; } 程序的输出结果是( )。
A.val=10 const:val=20
B.const:val=10 const:val=20
C.const:val=10 val=20
D.val=10 val=20
第3题:
在窗体上画一个命令按钮,然后编写如下事件过程: x = 0 Do Until x = -1 a = val(InputBox("A的值")):b = val(InputBox("B的值")) x = val(InputBox("x的值")) a = a + b + x Loop Print a 程序运行后,单击命令按钮,依次在输入对话框中输入5、4、3、2、1、-1,则输出结果为_____。
A.14
B.3
C.2
D.12
第4题:
下列程序的输出结果为( )。
S1=”1”:S2=”2”:SI=Val(S1)+Val(S2):S2=Val(”12”)
If S1<>S2 Then P int S1-S2 Else Print s1-S2
A. -9
B. 9
C. -12
D. 0
第5题:
下列程序的输出结果为( )。 #include<iostream.h> class TestClass { public: TestClass (){val++;} static int val; }; int TestClass::val=0; void main() { TestClass cs1; cout<<cs1.val<<""; TestClass cs2; TestClass cs3,cs4; cout<<cs2.val<<endl; }
A.03
B.13
C.14
D.24