[填空题] 有一个过程如下: Sub Sub1(m As Integer,total As Long) Dim i AS Integer   total=1   For i=1 To m     to

[填空题] 有一个过程如下: Sub Sub1(m As Integer,total As Long) Dim i AS Integer   total=1   For i=1 To m     to,第1张

[填空题] 有一个过程如下: Sub Sub1(m As Integer,total As Long) Dim i AS Integer   total=1   For i=1 To m     to

[填空题] 有一个过程如下: Sub Sub1(m As Integer,total As Long) Dim i AS Integer   total=1   For i=1 To m     total=total*i   Next End Sub 调用它的事件过程如下: Private Sub Command1_Click() Dim tot As Long,a As Integer   a=Val(InputBox("请输入数据"))   Call Subl(a,tot)   Print tot End Sub 则输入数据5,运行结果为______。

正确答案:

120

参考解析:

[命题目的] 考查考生对过程中参数传递方式的掌握情况。 [解题要点] 本题的难点是实参与形参的传递问题。total按ByRef参数传递。子过程的功能是计算n!,题中输入5,因此5!=120。 [错解分析] 参数按传值方式传递时,不改变实参中的值;按传地址的方式传递时,实参和形参指向的内容被改变。 [考点链接] 参数传递方式的概念和应用。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5590921.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-14
下一篇2022-12-14

发表评论

登录后才能评论

评论列表(0条)

    保存