阅读下面程序,写出输出结果。
#include using namespace std ; class A { int a, b; public : A() { a = b = 0; }
A(int aa, int bb) { a = aa; b = bb; cout << a << ' ' << b << endl ; } }; int main() { A x, y(2,3);
return 0; }
第1题
阅读下列程序并写出程序运行结果。
Private Sub Form_Click()
Dim x As Integer
Static y As Integer
x = x + 2
y = y + 3
Form1.Print "x="; x, "y="; y
End Sub
写出程序运行时连续单击三次窗体后,Form1上的输出结果。
第2题
写出下面程序运行时单击窗体的输出结果。
Private Sub f(a%, b%)
a = a + b
b = a - b
End Sub
Private Sub Form_Click()
Dim a%, b%
a = 23
b = 12
Call f(a, b)
Print "a=" & a; ",b=" & b
End Sub
第3题
程序题,具体题目内容如下:
请写出下面程序的输出结果。
def deco(func):
def inner(*args, **kwargs):
func(*args, **kwargs)
print('deco')
return inner
@deco
def func(a,b):
print('a*b=%d'%(a*b))
if __name__=='__main__':
func(3,5)
第4题
A.12
B.123
C.12345
D.0
第5题
第6题
第7题
阅读下列程序并写出程序运行结果。
Private Sub Command1_Click()
x = 0
Do While x < 60
x = (x + 3) * (x + 4)
n = n + 1
Loop
Text1.Text = Str(n)
Text2.Text = Str(x)
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
End Sub
写出程序运行后,文件框Text3的结果。
第8题
阅读下列程序并写出程序运行结果。
Public Sub change1(ByVal x As Integer, ByVal y As Integer)
Dim t As Integer
t = x
x = y
y = t
End Sub
Public Sub change2(x As Integer, y As Integer)
Dim t As Integer
t = x
x = y
y = t
End Sub
Private Sub Form_Click()
Dim a As Integer, b As Integer
a = 22: b = 33
change1 a, b
Form1.Print "A1="; a, "B1="; b
a = 22: b = 33
change2 a, b
Form1.Print "A2="; a, "B2="; b
End Sub
写出程序运行时,单击窗体Form1上的输出结果。
第9题
阅读下面的程序,填写程序中缺少的部分,并把程序的输出结果写出来;
classTest{
staticvoidShowArrayInfo(int[]student){
for(inti=0;i
Console.Write(student[i]++);
Console.Write(“”);
}
}
staticvoidMain(){
int[]student=newint[]{1,2,3,4,5};
ShowArrayInfo(student);
Console.Write(“/n”);
ShowArrayInfo(student);
}
}
输出结果:
第10题
阅读下列程序并写出程序运行结果。
Private Sub Form_Click()
Dim A(1 To 3) As String
Dim c As Integer
Dim j As Integer
A(1) = "4"
A(2) = "8"
A(3) = "12"
c = 1
For j = 1 To 3
c = c + Val(A(j))
Next j
Print c
End Sub
写出程序运行时单击窗体后,窗体Form1上的结果。
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!