题目
c#编写一个学生成绩计算程序,统计出一个班学生的某门课程各分数段的人数(分数段:90分以上,80-90,70-80,
编写一个学生成绩计算程序,统计出一个班学生的某门课程各分数段的人数(分数段:90分以上,80-90,70-80,60-70,60分以下)
成绩的计算方式是:平时成绩*40%+期末成绩*60%=最终成绩.
并显示出该班该门课的最高成绩和学生姓名,最低成绩和学生姓名
求教怎么修改
下面粘代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace xx
{
class Program
{
static void Main(string[] args)
{
int[] score = new int[10]; string[] m = { };
int i, a, b, c, d, e;
a = b = c = d = e = 0;
double[] math = new double[10];
double t = 0, max, min, r;
//int i;
Console.WriteLine("请输入20名学生的成绩 每名学生成绩输入后按回车输入下一位");
for (i = 0; i < 10; i++)
score[i] = Convert.ToInt32(Console.ReadLine());
for (i = 0; i < 10; i++)
{
switch (score[i] / 10)
{
提问时间:2021-02-26
编写一个学生成绩计算程序,统计出一个班学生的某门课程各分数段的人数(分数段:90分以上,80-90,70-80,60-70,60分以下)
成绩的计算方式是:平时成绩*40%+期末成绩*60%=最终成绩.
并显示出该班该门课的最高成绩和学生姓名,最低成绩和学生姓名
求教怎么修改
下面粘代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace xx
{
class Program
{
static void Main(string[] args)
{
int[] score = new int[10]; string[] m = { };
int i, a, b, c, d, e;
a = b = c = d = e = 0;
double[] math = new double[10];
double t = 0, max, min, r;
//int i;
Console.WriteLine("请输入20名学生的成绩 每名学生成绩输入后按回车输入下一位");
for (i = 0; i < 10; i++)
score[i] = Convert.ToInt32(Console.ReadLine());
for (i = 0; i < 10; i++)
{
switch (score[i] / 10)
{
提问时间:2021-02-26
答案
int[] score = new int[10]; string[] m = { };
int i, a, b, c, d, e;
a = b = c = d = e = 0;
double t = 0, max, min, r;
Console.WriteLine("请输入20名学生的成绩 以回车符区分");
for (i = 0; i < 10; i++)
{
int inputScore = 0;
if (!int.TryParse(Console.ReadLine(), out inputScore))
{
Console.WriteLine("请输入数字类型成绩");
i--;
}
score[i] = inputScore;
}
for (i = 0; i < 10; i++)
{
switch (score[i] / 10)
{
case 10:
case 9: a++; break;
case 8: b++; break;
case 7: c++; break;
case 6: d++; break;
default: e++;
break;
}
}
max = score[0];
min = score[0];
for (i = 0; i < 10; i++)
{
t += score[i];
if (score[i] > max) max = score[i];
if (score[i] < min) min = score[i];
}
r = t / 10;
Console.WriteLine("平均分为:{0}", r);
Console.WriteLine("最高分为:{0}", max);
Console.WriteLine("最低分为:{0}", min);
Console.WriteLine("得优人数 :{0}", a);
Console.WriteLine("得良人数 : {0}", b);
Console.WriteLine("得好人数 :{0}", c);
Console.WriteLine("及格人数 :{0}", d);
Console.WriteLine("不及格人数 :{0}", e);
Console.ReadLine();
int i, a, b, c, d, e;
a = b = c = d = e = 0;
double t = 0, max, min, r;
Console.WriteLine("请输入20名学生的成绩 以回车符区分");
for (i = 0; i < 10; i++)
{
int inputScore = 0;
if (!int.TryParse(Console.ReadLine(), out inputScore))
{
Console.WriteLine("请输入数字类型成绩");
i--;
}
score[i] = inputScore;
}
for (i = 0; i < 10; i++)
{
switch (score[i] / 10)
{
case 10:
case 9: a++; break;
case 8: b++; break;
case 7: c++; break;
case 6: d++; break;
default: e++;
break;
}
}
max = score[0];
min = score[0];
for (i = 0; i < 10; i++)
{
t += score[i];
if (score[i] > max) max = score[i];
if (score[i] < min) min = score[i];
}
r = t / 10;
Console.WriteLine("平均分为:{0}", r);
Console.WriteLine("最高分为:{0}", max);
Console.WriteLine("最低分为:{0}", min);
Console.WriteLine("得优人数 :{0}", a);
Console.WriteLine("得良人数 : {0}", b);
Console.WriteLine("得好人数 :{0}", c);
Console.WriteLine("及格人数 :{0}", d);
Console.WriteLine("不及格人数 :{0}", e);
Console.ReadLine();
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
- 1regret 过去式和分词是原形吗?
- 2{求英语成分解析}We will make our country more beautiful这个句子里,more beautifu作什么?
- 3英语翻译:之后,我们开始爬山
- 4一列客车长190米,一列货车长290米,客车的速度与货车的速度比为5:3,已知它们同向行驶时,辆车交叉时间为
- 5the books cover every inch of floor space. they take up a lot of ( ) A roomBplaceCareaDspace 请解释
- 6120千克的3/8比它得3倍少多少千克?
- 7可以提供给我一篇英语演讲稿,有关介绍上海的.2分钟左右.
- 8升国旗的时候旗杆上用是动滑轮吗
- 9在一个直角三角形中,一个锐角是另一个锐角的2倍,这两个锐角分别是多少度?
- 10全体少先队员分成栽树和挖坑两组,且栽树和挖坑人数比是3:4,如果从栽树组调2个人到挖坑组,那么栽树组和挖坑组人数的比就是2:3,请你算一下有多少少先队队员参加了这次植树活动?
热门考点
- 1-1+2-3+4-5+.-1997+1998-1999等于多少(-是符号)
- 2My cousin watches three hours of TV every week(对划线部分提问)___
- 3【英语书面表达】新学期要到了,写一篇有关新学期的计划,讲述一下自己打算在新学期里要做些什么.例如:可以写自己在学习,娱乐,健身,培养业余爱好等方面的计划或打算
- 4Where ____ your brother usually ____ for lunch?空怎么填?
- 5I usually go shopping on sunday morning还是in sunday morning?
- 6《我不懂英语》用英语怎么说
- 7设集合A={c,d},试写出A的所有子集,并指出其中的真子集?
- 8We have two classes in Computer Science every week.【改成否定句】
- 9把两个全等的等腰直角三角形,使点C,B,E在同一直线上,连接CD,若AC=6cm,BC=8cm,AB=10cm,求△BCD面积
- 10山中访友 山泉和白云会回答什么