分享

5-11undefined跳转语句之return语句

 工厂应用 2019-08-20
 

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;
        }
    }
}

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约