using System;
namespace Exponent
{
internal class Program
{
static void Main()
{
Console.Write("Введите a: ");
double a = double.Parse(Console.ReadLine());
Console.Write("Введите b: ");
double b = double.Parse(Console.ReadLine());
Console.Write("Введите c: ");
double c = double.Parse(Console.ReadLine());
if ((a + b + c) == 0)
Console.WriteLine("a + b + c = 0");
else
{
double exp = Math.Exp((Math.Pow(a, 2) + Math.Pow(b, 2) + Math.Pow(c, 2)) / (a + b + c));
Console.WriteLine($"e = {exp}");
}
Console.ReadKey();
}
}
}
static double MinDiff(IEnumerable a, double b)
{
double Result = a.First();
foreach (double x in a)
if (Math.Abs(x - b) < Math.Abs(b - Result))
Result = x;
return Result;
}
static void Main(string[] args)
{
const double epsilon = 1e-5;
double[] a = new double[3];
int i = 0;
for (char c = 'a'; c <= 'c'; c++)
{
Console.Write($"{c}=");
a[i++] = double.Parse(Console.ReadLine());
}
if (Math.Abs(a.Sum()) < epsilon)
throw new DivideByZeroException(); // You may want to just show a message instead
var e = a.Select(x => x * x).Sum() / a.Sum();
Console.WriteLine(Math.Exp(MinDiff(a, e)));
}