Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Input #1, N Close #1
Open App.Path & "\out.txt" For Output As #2
For i = 1 To N If Len(i) <> 2 Then Print #2, " "; Print #2, i; For j = 1 To (i - 1) If Len(i * (j + 1)) <> 2 Then Print #2, " "; Print #2, i * (j + 1); Next j Print #2, Next i
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, t For i = 1 To t For j = 1 To i Print #2, i * j & " "; 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 i = 1 To N
For j = 1 To i
ans = i * j
If Len(ans) <> 2 Then ans = " " & ans
Print #2, " " & ans;
Next
Print #2, ""
Next
Close #1
Close #2
End
End Sub
-----------
這個春節到台東去玩 ~
昨晚才到家
嗯...進度嚴重落後
arro好,
回覆刪除(我也終於又用筆電回復,比用ipad回復,容易多了)。
這題OK。
另外,其它的人,加油啊。實力與耐力是需要累積的。
熊掌
Dim N As Byte
回覆刪除Private Sub Form_Load()
Me.Hide
Open App.Path & "\in.txt" For Input As #1
Input #1, N
Close #1
Open App.Path & "\out.txt" For Output As #2
For i = 1 To N
If Len(i) <> 2 Then Print #2, " ";
Print #2, i;
For j = 1 To (i - 1)
If Len(i * (j + 1)) <> 2 Then Print #2, " ";
Print #2, i * (j + 1);
Next j
Print #2,
Next i
Close #2
End
End Sub
要加油了我!!
佑好,
回覆刪除程式ok.
你們兩個都是用len這個函數來測長度,是可以。但是,直接拿來和10相比,就可以了。
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\out.txt" For Output As #2
Open App.Path & "\in.txt" For Input As #1
Input #1, x
For i = 1 To x
For j = 1 To i
Print #2, i * j;
Next j
Print #2,
Next i
Close #1
Close #2
End
End Sub
緣尉~
回覆刪除注意輸出的"空格"
你的結果跟範例的空格位置不一樣噢
(想說你的居然比我的簡潔)
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\out.txt" For Output As #2
Open App.Path & "\in.txt" For Input As #1
Input #1, x
For i = 1 To x
For j = 1 To i
If (i * j) < 10 Then
Print #2, " " & i * j;
Else
Print #2, " " & i * j;
End If
Next j
Print #2,
Next i
Close #1
Close #2
End
End Sub
-------------------
謝謝Arro~
這樣算不算硬性扭曲結果XD?
緣尉好,
回覆刪除還是有錯哦,你的then 跟 else兩個內容是一樣的。
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, t
For i = 1 To t
For j = 1 To i
Print #2, i * j & " ";
Next
Print #2, ""
Next
Close
Close
End
End Sub
1:17