24h購物| | PChome| 登入
2008-05-22 11:48:31| 人氣90| 回應0 | 上一篇 | 下一篇

讀檔並排列(vb)

推薦 0 收藏 0 轉貼0 訂閱站台

Private Sub Command1_Click()
Dim i As Integer
Dim j As Integer
Dim n As Integer

Open App.Path & ”1.txt” For Input As #1
Do
Input #1, n
For i = 1 To n
For j = 1 To i
Print j;
Next j
Print
Next i
Loop Until EOF(1)
Close #1
End Sub

Private Sub Command2_Click()
Dim i As Integer
Dim j As Integer
Dim n As Integer

Open App.Path & ”1.txt” For Input As #1
Do
Input #1, n
For i = n To 1 Step -1
For j = i To 1 Step -1
Print j;
Next j
Print
Next i
Loop Until EOF(1)
Close #1
End Sub

台長: *~葉子~*
人氣(90) | 回應(0)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 不分類

是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入圖片中算式的結果(可能為0) 
(有*為必填)
TOP
詳全文