未知题型

设有一个命令按钮Command1的事件过程以及一个函数过程。程序如下:
Private Sub Command1 Click( )
Static x A S Integer
x=f(x+5)
Cls
Print X
End Sub
Private Function f(x As Integer)As Integer
f=x+x
End Function
连续单击命令按钮3次,第3次单击命令按钮后,窗体显示的计算结果是( )。
A.10
B.30
C.60
D.70

A.10
B.30
C.60
D.70
【参考答案】

D
D。【解析】本题考查静态变量,静态变量能将执行后的值储存到变量中。所以当第一次单击按钮时,x=5,x=f(x......

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)