Archived
1
0

optimise files

This commit is contained in:
2025-11-25 20:14:10 +08:00
Unverified
parent bb4a37acc4
commit 4e148364a9
171 changed files with 6555 additions and 0 deletions

11
CS/15.1/15.1.csproj Normal file
View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>_15._1</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

25
CS/15.1/15.1.sln Normal file
View File

@@ -0,0 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36623.8 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "15.1", "15.1.csproj", "{816086E8-93CF-41C4-8DC4-EE4B44FE918B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{816086E8-93CF-41C4-8DC4-EE4B44FE918B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{816086E8-93CF-41C4-8DC4-EE4B44FE918B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{816086E8-93CF-41C4-8DC4-EE4B44FE918B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{816086E8-93CF-41C4-8DC4-EE4B44FE918B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F6856EF0-4074-451B-9ED7-D1F4FC4E61BD}
EndGlobalSection
EndGlobal

54
CS/15.1/Program.cs Normal file
View File

@@ -0,0 +1,54 @@
using System;
using System.Drawing;
namespace _15._1
{
class MathTriangle
{
private double sideA;
private double sideB;
private double sideC;
public MathTriangle(double a, double b, double c)
{
sideA = Math.Abs(a);
sideB = Math.Abs(b);
sideC = Math.Abs(c);
}
public double GetArea()
{
double s = (sideA + sideB + sideC) / 2;
return Math.Sqrt(s * (s - sideA) * (s - sideB) * (s - sideC));
}
public double GetPerimeter()
{
return sideA + sideB + sideC;
}
public double GetHeight()
{
double area = GetArea();
return (2 * area) / sideA;
}
public double GetMaxSide()
{
return Math.Max(sideA, Math.Max(sideB, sideC));
}
public double GetMinSide()
{
return Math.Min(sideA, Math.Min(sideB, sideC));
}
private double GetPartSideA()
{
return Math.Sqrt((Math.Pow(sideB, 2.0) - Math.Pow(GetHeight(), 2.0)));
}
static void Main()
{
MathTriangle triangle = new MathTriangle(16.0, 10.0, 8.0);
Console.WriteLine("三角形三边长分别为: {0}, {1}, {2}", triangle.sideA, triangle.sideB, triangle.sideC);
Console.WriteLine("三角形的面积为: {0:#.00}", triangle.GetArea());
Console.WriteLine("三角形的周长为: {0}", triangle.GetPerimeter());
Console.WriteLine("三角形的A边高为: {0:#.00}", triangle.GetHeight());
Console.WriteLine("三角形的最大边为: {0}", triangle.GetMaxSide());
Console.WriteLine("三角形的最小边为: {0}", triangle.GetMinSide());
}
}
}