누구든지 Visual Studio에서 if 또는 if 문을 좋아하지 않는 이유를 설명해주십시오.또는 사용하는 경우
elseif
을 사용하여 동일한 작업을 수행 할 수 있다는 것을 알고 있지만 왜 작동하지 않는지 이해하려고합니다.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim input As String = "asdcessssf"
Dim count As Integer
Dim totalchar As Integer
Dim final As Integer
For Each ch As Char In input
If ch = "a" Or "e" Then
count += 1
totalchar += 1
Else
totalchar += 1
End If
Next
final = (count/totalchar) * 100
MsgBox(final)
End Sub
End Class
Or''에 대한 올바른 구문은'만약 CH = "A"또는이다 ch = "e"Then' –