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/CS/lab10/10_1/Program.cs
2026-03-19 19:39:01 +08:00

26 lines
1012 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.
namespace _10_1
{
internal class Program
{
static void Main(string[] args)
{
double a, b, c, p, h, area;
Console.WriteLine("输入三角形的直角边A");
a = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("输入三角形的直角边B");
b = Convert.ToDouble(Console.ReadLine());
c = Math.Sqrt(a * a + b * b);
Console.WriteLine("直角三角形的三边分别为a={0},b={1},c={2}");
p = a + b + c;
h = p / 2;
area = Math.Sqrt(h * (h - a) * (h - b) * (h - c));
Console.WriteLine("直角三角形的周长为{0},面积为:{1}", p, area);
double sinA= a / c;
double aAngel= Math.Asin(sinA) * 180 / Math.PI;
double cosB= a / c;
double bAngel= Math.Acos(cosB) * 180 / Math.PI;
Console.WriteLine("直角三角形的角A为{0},角B为{1}", aAngel, bAngel);
}
}
}