为了账号安全,请及时绑定邮箱和手机立即绑定

c#类

标签:
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

https://img1.sycdn.imooc.com//5caea17a000106a301400140.jpg


点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

举报

0/150
提交
取消