假定有下面的程序: Private Sub Form_Click() Dim N As Integer N = InputBox("输入一个2位整数") Print (N - Int(N / 10) * 10) * 10 + Int(N /

admin2015-06-30  17

问题 假定有下面的程序:
Private Sub Form_Click()
    Dim N As Integer
N = InputBox("输入一个2位整数")
    Print (N - Int(N / 10) * 10) * 10 + Int(N / 10)
End Sub
程序运行后,单击窗体,在输入对话框中输入58,然后单击"确定"按钮,输出结果是

选项 A、58
B、13
C、85
D、40

答案C

解析 当输入58后,N=58,则Int(x)返回值为不大于自变量x的最大整数,则Int(N/10)返回的值为5,则结果为(58-5*10)*10+5=85。故C选项正确。
转载请注明原文地址:https://kaotiyun.com/show/d0Qp777K
0

最新回复(0)