using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _5_11_跳转语句之return语句 { class Program { static void Main(string[] args) { while (true) { Console.WriteLine("输入三个整数"); int a = int.Parse(Console.ReadLine()); int b = int.Parse(Console.ReadLine()); int c = int.Parse(Console.ReadLine()); /*double average = (a + b + c) / 3;*/ double Average = average(a, b, c); Console.WriteLine("平均数是:{0}", Average); //Console.ReadLine(); } } static double average(int a, int b, int c) { return (a + b + c) / 3; } } }
|
|
来自: 工厂应用 > 《51自学网C#学习笔记》