double dA, dB, dC, dX1, dX2; double dD; Console.Write("请输入A的值:"); dA = Convert.ToDouble(Console.ReadLine()); Console.Write("请输入B的值:"); dB = Convert.ToDouble(Console.ReadLine()); Console.Write("请输入C的值:"); dC = Convert.ToDouble(Console.ReadLine()); //周长 dX1 = dA + dB + dC; //面积 double dZ = dX1 / 2; dX2 = Math.Sqrt(dZ * (dZ - dA) * (dZ - dB) * (dZ - dC)); //角度 dD = Math.Acos((dC * dC + dB * dB - dA * dA) / (2 * dC * dB)) * 180 / 3.1415926; Console.WriteLine("a角度" + dD); dD = Math.Acos((dA * dA + dC * dC - dB * dB) / (2 * dC * dA)) * 180 / 3.1415926; Console.WriteLine("b角度" + dD); dD = Math.Acos((dA * dA + dB * dB - dC * dC) / (2 * dA * dB)) * 180 / 3.1415926; Console.WriteLine("c角度" + dD); Console.WriteLine("周长:" + dX1); Console.WriteLine("面积: " + dX2); Console.ReadKey();