它说第32行的错误.... 给定的代码是visual basic。我想我的一切都是正确的,但不知道我做错了什么。当我在控制台中检查它时,它说第32行
Module Module1
Sub Main()
Dim isInKG As Boolean = Nothing
Dim canDrink As Boolean = Nothing
Dim isSeniorCitizen As Boolean = Nothing
Console.WriteLine("what is your age?")
Dim age As Integer = Console.ReadLine()
Dim outcomeKG As String = Nothing
Dim outcomeSenior As String = Nothing
Dim outcomeDrink As String = Nothing
If age <> 5 Then
isInKG = False
outcomeKG = "You arent in KG"
Else
isInKG = True
outcomeKG = "You are in KG"
End If
If age >= 65 Then
isSeniorCitizen = True
outcomeSenior = "You are a Senior Citizen"
Else
isSeniorCitizen = False
outcomeSenior = "You are a Junior Citizen"
End If
If age >= 21 Then
canDrink = True
outcomeDrink = "Go and get drunk"
Else
canDrink = False
outcomeDrink = "Sorry Kiddo Not until 21 "
End If
Console.WriteLine(outcomeDrink & " " & outcomeKG & " " & outcomeSenior " " &)
Console.ReadLine()
End Sub
End Module
答案 0 :(得分:0)
从底部开始的第三行有错误的顺序...... 试试这个
Console.WriteLine(outcomeDrink & " " & outcomeKG & " " & outcomeSenior & " ")