回覆列表
-
1 # 棠棠愛學習吖
-
2 # DevilOrNot
用VB程式設計,將輸入的字串以反序輸出
兩種方法:程式碼如下
Private Sub Command1_Click()
Dim S As String, T As String
S = InputBox("輸入一個字串")
Print T
Dim I As Integer
For I = Len(S) To 1 Step -1
T = T & Mid(S, I, 1)
Next
Print T
End Su
第二種簡單版。
Private Sub Command1_Click()
Dim S As String, T As String
S = InputBox("輸入一個字串")
"T = StrReverse(S)
End Sub
用VB程式設計,將輸入的字串以反序輸出
兩種方法:程式碼如下
Private Sub Command1_Click()
Dim S As String, T As String
S = InputBox("輸入一個字串")
Print T
Dim I As Integer
For I = Len(S) To 1 Step -1
T = T & Mid(S, I, 1)
Next
Print T
End Su
第二種簡單版。
Private Sub Command1_Click()
Dim S As String, T As String
S = InputBox("輸入一個字串")
"T = StrReverse(S)
End Sub