填空题
使用窗体的Click事件在窗体输出1~1000之间能同时被5和7整除的整数,如图所示,请填空。
Private Sub Form_Click() Dim i As Integer Dim Sum As Integer Cls For i=1 To 1000 If
【11】
Then Sum=Sum+i Printi End If Next i Print Print"Sum="&Sum End Sub
【参考答案】
i Mod 5=0 And i Mod 7=0
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
执行下面的程序,消息框里显示的结果是 【13】 。Private Sub Form_Click()Dim Str As String,K As IntegerStr= ab ,For k=Len(Str)To 1 Step-1Str=-Str & Chr(Asc(Mid(Str,k,1))+k)Next kMsgBox StrEnd Sub
点击查看答案&解析
填空题
在窗体上添加一个命令按钮(名为Command1),然后编写如下程序:Function m(x as Integer,y as InteSer)as Integerm=IIf(x>y,x,y)EndFunctionPrivate Sub Command1_Click()Dim a as Integer,b as InteSera=lb=2MsgBox m(a,B) End Sub打开窗体运行后,单击命令按钮,消息框的输出结果为 【12】 。
点击查看答案&解析
相关试题
有如下程序段:Public Sub xy (a As ...
阅读下面的程序段:for i=1 to 3for...