Archived
1
0
This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
SomeLab/cs4/CS4_2/Program.cs
2025-11-01 08:20:49 +08:00

37 lines
974 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
namespace CS4_2
{
public class Program
{
static void Main(string[] args)
{
int[] score = { 80, 90, 67, 89, 78, 85, 45, 65, 77, 95 };
// 统计分数段
int a = 0, b = 0, c = 0, d = 0;
for (int i = 0; i < score.Length; i++)
{
if (score[i] >= 90)
{
a++;
}
else if (score[i] >= 80)
{
b++;
}
else if (score[i] >= 60)
{
c++;
}
else
{
d++;
}
}
Console.WriteLine("90分及以上人数" + a);
Console.WriteLine("80-89分人数" + b);
Console.WriteLine("60-79分人数" + c);
Console.WriteLine("60分以下人数" + d);
}
}
}