Private Sub Form_Load() 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 ans = 0 Line Input #1, x For j = 1 To Len(x) k = Mid(x, j, 1) If k > "A" And k < "z" Then ans = ans + 1 End If Next j Print #2, ans Next i Close #1 Close #2 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 j = 1 To x ans = 0 Line Input #1, ss For i = 1 To Len(ss) If ("A" <= Mid(ss, i, 1)) And (Mid(ss, i, 1) <= "z") Then ans = ans + 1 End If Next i Print #2, ans Next j Close #2 Close #1 End Sub 普通的 判斷大小
Dim str(50) As String Dim aa(1000) As String Dim x As String Private Sub Form_Load() Open App.Path & "/in.txt" For Input As #1 Open App.Path & "/out.txt" For Output As #2 n = 0 Do Until EOF(1) Input #1, x str(n) = x n = n + 1 Loop ans = 0 For i = 1 To n - 1 For j = 1 To Len(str(i)) aa(j) = Mid(str(i), j, 1) If aa(j) > "A" And aa(j) < "z" Then ans = ans + 1 End If Next j Print #2, ans ans = 0 Next i Close #2 Close #1 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, n For i = 1 To n ans = 0 Line Input #1, x x = LCase(x) For j = 1 To Len(x) y = Mid(x, j, 1) If y >= "a" And y <= "z" Then ans = ans + 1 Next j Print #2, ans Next i Close #2 Close #1 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, n
For i = 1 To n
ans = 0
Line Input #1, x
For j = 1 To Len(x)
k = Mid(x, j, 1)
If k > "A" And k < "z" Then
ans = ans + 1
End If
Next j
Print #2, ans
Next i
Close #1
Close #2
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 j = 1 To x
ans = 0
Line Input #1, ss
For i = 1 To Len(ss)
If ("A" <= Mid(ss, i, 1)) And (Mid(ss, i, 1) <= "z") Then
ans = ans + 1
End If
Next i
Print #2, ans
Next j
Close #2
Close #1
End Sub
普通的 判斷大小
Dim str(50) As String
回覆刪除Dim aa(1000) As String
Dim x As String
Private Sub Form_Load()
Open App.Path & "/in.txt" For Input As #1
Open App.Path & "/out.txt" For Output As #2
n = 0
Do Until EOF(1)
Input #1, x
str(n) = x
n = n + 1
Loop
ans = 0
For i = 1 To n - 1
For j = 1 To Len(str(i))
aa(j) = Mid(str(i), j, 1)
If aa(j) > "A" And aa(j) < "z" Then
ans = ans + 1
End If
Next j
Print #2, ans
ans = 0
Next i
Close #2
Close #1
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, n
For i = 1 To n
ans = 0
Line Input #1, x
x = LCase(x)
For j = 1 To Len(x)
y = Mid(x, j, 1)
If y >= "a" And y <= "z" Then ans = ans + 1
Next j
Print #2, ans
Next i
Close #2
Close #1
End Sub
高仔好,
回覆刪除這題會不會太簡單了一點呢?
而放了這麼久才做。