栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

c#类

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

c#类

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;


namespace ConsoleApplication1

{

    public class student

    {

        public string xh;

        public string xm;

        public string xb;


        public double yw;

        public double sx;

        public double yy;


        public student()

        {


        }

    }

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("请输入第一位学生信息:");

            student st1=new student();

            Console.Write("学号");

            st1.xh=Console.ReadLine();

            Console.Write("姓名");

            st1.xm=Console.ReadLine();

            Console.Write("性别");

            st1.xb = Console.ReadLine();

            Console.Write("语文成绩");

            st1.yw = Convert.ToDouble(Console.ReadLine());

            Console.Write("数学成绩");

            st1.sx = Convert.ToDouble(Console.ReadLine());

            Console.Write("英语成绩");

            st1.yy = Convert.ToDouble(Console.ReadLine());


            ////////////////////////////////////////////////////////


            Console.WriteLine("请输入第一位学生信息:");

            student st2 = new student();

            Console.Write("学号");

            st2.xh = Console.ReadLine();

            Console.Write("姓名");

            st2.xm = Console.ReadLine();

            Console.Write("性别");

            st2.xb = Console.ReadLine();

            Console.Write("语文成绩");

            st2.yw = Convert.ToDouble(Console.ReadLine());

            Console.Write("数学成绩");

            st2.sx = Convert.ToDouble(Console.ReadLine());

            Console.Write("英语成绩");

            st2.yy = Convert.ToDouble(Console.ReadLine());


            ////////////////////////////////////////////////////////


            Console.WriteLine("请输入第一位学生信息:");

            student st3 = new student();

            Console.Write("学号");

            st3.xh = Console.ReadLine();

            Console.Write("姓名");

            st3.xm = Console.ReadLine();

            Console.Write("性别");

            st3.xb = Console.ReadLine();

            Console.Write("语文成绩");

            st3.yw = Convert.ToDouble(Console.ReadLine());

            Console.Write("数学成绩");

            st3.sx = Convert.ToDouble(Console.ReadLine());

            Console.Write("英语成绩");

            st3.yy = Convert.ToDouble(Console.ReadLine());


            ///////////////////////////////////////////////////////


            Console.WriteLine("学号t姓名t性别t语文t数学t英语t总分t平均分");

            Console.WriteLine("{0}t{1}t{2}t{3}t{4}t{5}t{6}t{7}", st1.xh, st1.xm, st1.xb, st1.yw, st1.sx, st1.yy, (st1.yw + st1.sx + st1.yy).ToString("0.00"),((st1.yw + st1.sx + st1.yy)/3).ToString("0.00"));

            Console.WriteLine("{0}t{1}t{2}t{3}t{4}t{5}t{6}t{7}", st2.xh, st2.xm, st2.xb, st2.yw, st2.sx, st2.yy, (st2.yw + st2.sx + st2.yy).ToString("0.00"), ((st2.yw + st2.sx + st2.yy) / 3).ToString("0.00"));

            Console.WriteLine("{0}t{1}t{2}t{3}t{4}t{5}t{6}t{7}", st3.xh, st3.xm, st3.xb, st3.yw, st3.sx, st3.yy, (st3.yw + st3.sx + st3.yy).ToString("0.00"), ((st3.yw + st3.sx + st3.yy) / 3).ToString("0.00"));

            Console.ReadKey();

        }

    }

}

cd Desktop

dir

copy /b xx.jpg+xx.rar xx.jpg


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/230894.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号