美文网首页
2018-10-25

2018-10-25

作者: 柏建春 | 来源:发表于2018-10-25 09:28 被阅读0次

    #代码

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    namespace ConsoleApplication3

    {

        class Program

        {

            static void Main(string[] args)

            {

                Console.WriteLine("请输入你的姓名");

                string strname = Console.ReadLine();

                Console.WriteLine("请输入你的语文成绩");

                string strChinese = Console.ReadLine();

                Console.WriteLine("请输入你的数学成绩");

                string strMath = Console.ReadLine();

                Console.WriteLine("请输入你的英语成绩");

                string strEnglish = Console.ReadLine();

                int chinese = Convert.ToInt32(strChinese);

                int math = Convert.ToInt32(strMath);

                int english = Convert.ToInt32(strEnglish);

                int total = chinese + math + english;

                Console.WriteLine("你的总分为{0}",total);

                int average = total / 3;

                Console.WriteLine("你的平均分为{0}",average);

                Console.ReadKey();

            }

        }

    }

    #效果

    相关文章

      网友评论

          本文标题:2018-10-25

          本文链接:https://www.haomeiwen.com/subject/kiqqtqtx.html