Пример #1
0
    static void Main(string[] args)
    {
        var howManyInputs = int.Parse(Console.ReadLine());

        var phoenicsList = new List <Phoenics>();

        for (int i = 0; i < howManyInputs; i++)
        {
            var bodyLength = int.Parse(Console.ReadLine());

            var bodyWidth = decimal.Parse(Console.ReadLine());

            var wingLength = int.Parse(Console.ReadLine());

            var currentPhoenics = new Phoenics(bodyLength, bodyWidth, wingLength);

            phoenicsList.Add(currentPhoenics);
        }

        foreach (var phoenics in phoenicsList)
        {
            var time = CalculateTheTime(phoenics);

            Console.WriteLine(time);
        }
    }
Пример #2
0
    private static decimal CalculateTheTime(Phoenics phoenics)
    {
        var a = Convert.ToDecimal(Math.Pow(phoenics.BodyLength, 2));

        var b = Convert.ToDecimal(2 * phoenics.WingLength + phoenics.BodyWidth);

        return(a * b);
    }