2007-11-07 23:50:12孩子氣☻
(VB)Select Case
Dim a, b, c As Integer
Console.Write("請輸入基電成績:")
a = Console.ReadLine()
If a >= 0 And a <= 100 Then
Console.WriteLine()
Else
Console.Write("你輸入的成績有誤!")
Console.ReadKey()
End
End If
Console.Write("請輸入電子學成績:")
b = Console.ReadLine()
If b >= 0 And b <= 100 Then
Console.WriteLine()
Else
Console.Write("你輸入的成績有誤!")
Console.ReadKey()
End
End If
Console.Write("請輸入記概成績:")
c = Console.ReadLine()
If c >= 0 And c <= 100 Then
Console.WriteLine()
Else
Console.Write("你輸入的成績有誤!")
Console.ReadKey()
End
End If
Console.Write("你的總分為:")
Console.Write(a + b + c)
Console.WriteLine()
Console.Write("你的平均為:")
Console.Write((a + b + c) / 3)
Console.WriteLine()
Select Case ((a + b + c) / 3)
Case Is >= 90
Console.Write("你的級數為優等!")
Case 80 To 90
Console.Write("你的級數為甲等!")
Case 70 To 80
Console.Write("你的級數為乙等!")
Case 60 To 70
Console.Write("你的級數為丙等!")
Case Else
Console.Write("你的級數為丁等!")
End Select
Console.ReadKey()