vb.写出1000以内能被357整除的数.并用write语句从小到大排列,并存入文件中.
问题描述:
vb.写出1000以内能被357整除的数.并用write语句从小到大排列,并存入文件中.
答
Private Sub Command1_Click()Dim a As IntegerDim i As IntegerOpen "out.dat" For Output As #1For i = 1 To 1000If i Mod 357 = 0 ThenWrite #1,iEnd IfNext iEnd Sub把它放到一个按钮的代码里就行不好意思,是被3或5或7整除...求答案那小等一下= = ----OK了----Private Sub Command1_Click() Dim i As Integer Open "out.dat" For Output As #1 For i = 1 To 1000 If i Mod 3 = 0 Then Write #1, i ElseIf i Mod 5 = 0 Then Write #1, i ElseIf i Mod 7 = 0 Then Write #1, i End If Next i End Sub