学生成绩统计器

using System;
using System.Collections.Generic;
using System.Text;

namespace 成绩统计器
{
    class Program
    {
        static void Main(string[] args)
        {
            //student(学生人数),shuru(输入成绩),max(最大成绩),min(最小成绩)
            //score30(0~30分区间)
            int student, shuru, max = 0, min = 0, score30 = 0, score59 = 0;
            int score79=0,score89=0,score100=0;
            Console.WriteLine("请输入班级人数");
            student = int.Parse(Console.ReadLine());
            for (int i =1;i<=student;i++)
            {
                Console .WriteLine ("请输入第"+i+"个成绩");
                shuru =int.Parse (Console.ReadLine ());
                if (i==1)
                {
                    min=shuru ;
                    max =shuru;
                }
                else
                {
                    if (max<shuru)
                    {
                        max=shuru;
                    }
                    if(min>shuru)
                    {
                        min=shuru;
                    }
                }
                if ((shuru>=0)&&(shuru <=30))
                {
                    score30++;
                }
                                if ((shuru>30)&&(shuru <=59))
                {
                    score59++;
                }
                                if ((shuru>59)&&(shuru <=79))
                {
                    score79++;
                }
                                if ((shuru>79)&&(shuru <=89))
                {
                    score89++;
                }
                                if ((shuru>89)&&(shuru <=100))
                {
                    score100++;
                }
            }
            Console.WriteLine("共" + student + "人,其中最大成绩" + max + ",最小成绩" + min);
            Console .WriteLine ("成绩区间 0~30的总人数共"+score30 +"人");
            Console .WriteLine ("成绩区间 31~59的总人数共"+score59 +"人");
            Console .WriteLine ("成绩区间 60~79 的总人数共"+score79 +"人");
            Console .WriteLine ("成绩区间 80~89的总人数共"+score89 +"人");
            Console.WriteLine("成绩区间 90~100的总人数共" + score100 + "人");

 


           
        }
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值