20251101
This commit is contained in:
10
cs4/CS4_2/CS4_2.csproj
Normal file
10
cs4/CS4_2/CS4_2.csproj
Normal file
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
25
cs4/CS4_2/CS4_2.sln
Normal file
25
cs4/CS4_2/CS4_2.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36616.10 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CS4_2", "CS4_2.csproj", "{D2BA0541-32E9-4C7D-AE89-9E7B7B49969C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D2BA0541-32E9-4C7D-AE89-9E7B7B49969C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D2BA0541-32E9-4C7D-AE89-9E7B7B49969C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D2BA0541-32E9-4C7D-AE89-9E7B7B49969C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D2BA0541-32E9-4C7D-AE89-9E7B7B49969C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {9CC792AC-CC4E-4F02-B199-034BABCE42D4}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
36
cs4/CS4_2/Program.cs
Normal file
36
cs4/CS4_2/Program.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user