Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Input #1, n For y = 1 To n For x = 1 To y If x * y < 10 Then Print #2, " "; Print #2, x * y; Next x Print #2, Next y Close #2 Close #1 End End Sub
Private Sub Form_Load() Open App.Path & "/in.txt " For Input As #1 Open App.Path & "/out.txt" For Output As #2 Input #1, x For i = 1 To x For j = 1 To i If i * j < 10 Then Print #2, " "; Print #2, i * j; Next j Print #2, Next i Close Close End End Sub
Private Sub Form_Load() Me.Hide Open App.Path & "/in.txt " For Input As #1 Open App.Path & "/out.txt" For Output As #2 Input #1, x For i = 1 To x For j = 1 To i If i * j < 10 Then Print #2, " "; Print #2, i * j; Next j Print #2, Next i Close Close End End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Input #1, x
a = 1
For i = 1 To x
For y = 1 To i
If i * y < 10 Then Print #2, " ";
Print #2, i * y;
Next
Print #2,
Next
Close
Close
End
End Sub
剛剛的A= 1 沒有刪除到 所以重貼一次!
回覆刪除Private Sub Form_Load()
Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Input #1, x
For i = 1 To x
For y = 1 To i
If i * y < 10 Then Print #2, " ";
Print #2, i * y;
Next
Print #2,
Next
Close
Close
End
End Sub
作者已經移除這則留言。
回覆刪除Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Input #1, n
For y = 1 To n
For x = 1 To y
If x * y < 10 Then Print #2, " ";
Print #2, x * y;
Next x
Print #2,
Next y
Close #2
Close #1
End
End Sub
Private Sub Form_Load()
回覆刪除Open App.Path & "/in.txt " For Input As #1
Open App.Path & "/out.txt" For Output As #2
Input #1, x
For i = 1 To x
For j = 1 To i
If i * j < 10 Then Print #2, " ";
Print #2, i * j;
Next j
Print #2,
Next i
Close
Close
End
End Sub
小冰,晟晟,哲好,
回覆刪除這樣的迴圈訓練,很好。
1
11
121
1331
14641
這樣的更有數學功力的排列呢?
試試吧。
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "/in.txt " For Input As #1
Open App.Path & "/out.txt" For Output As #2
Input #1, x
For i = 1 To x
For j = 1 To i
If i * j < 10 Then Print #2, " ";
Print #2, i * j;
Next j
Print #2,
Next i
Close
Close
End
End Sub