'Math.Round 做四捨五入
Sub Main()
    Dim x, y, z As Integer
    Console.WriteLine("  成績計算系統   ")
    Console.WriteLine("=================")
    Console.Write("輸入第一次成績:") : x = Console.ReadLine()
    Console.Write("輸入第二次成績:") : y = Console.ReadLine()
    Console.Write("輸入第三次成績:") : z = Console.ReadLine()
    Console.WriteLine("=================")
    Console.WriteLine("平均成績 = {0}", Math.Round((x + y + z) / 3, 2))
    Console.Read()
End Sub
文章標籤
全站熱搜
創作者介紹
創作者 colud77 的頭像
colud77

I-Cloud程式攻略

colud77 發表在 痞客邦 留言(0) 人氣(1,867)