Вопрос задан 06.08.2018 в 00:35. Предмет Информатика. Спрашивает Егоров Артём.

Треугольник задан длинами сторон. Найти длины медиан - надо в Паскале

0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Александров Ярослав.
Var
a, b, c, ma, mb, mc: real;
begin
read(a); read(b); read(c);
ma:=(sqrt(2*b*b+2*c*c-a*a))/2;
mb:=(sqrt(2*a*a+2*c*c-b*b))/2;
mc:=(sqrt(2*a*a+2*b*b-c*c))/2;
writeln('Медиана к стороне a=', ma:17:2);
writeln('Медиана к стороне b=', mb:17:2);
writeln('Медиана к стороне с=', mс:17:2);
end.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Finding the Lengths of Medians in Pascal

To find the lengths of medians of a triangle given the lengths of its sides in Pascal, you can use the formula for the length of a median in terms of the side lengths of the triangle. The formula for the length of a median in terms of the side lengths of a triangle is:

m_a = 0.5 * sqrt(2 * b^2 + 2 * c^2 - a^2)

m_b = 0.5 * sqrt(2 * a^2 + 2 * c^2 - b^2)

m_c = 0.5 * sqrt(2 * a^2 + 2 * b^2 - c^2)

Where a, b, and c are the lengths of the sides of the triangle, and m_a, m_b, and m_c are the lengths of the medians from vertices A, B, and C, respectively.

Now, let's use the given side lengths of the triangle to calculate the lengths of the medians using Pascal.

```pascal program CalculateMedians; var a, b, c, m_a, m_b, m_c: real; begin // Input the lengths of the sides of the triangle a := 15; // Replace with the actual length of side a b := 16; // Replace with the actual length of side b c := 17; // Replace with the actual length of side c

// Calculate the lengths of the medians m_a := 0.5 * sqrt(2 * b * b + 2 * c * c - a * a); m_b := 0.5 * sqrt(2 * a * a + 2 * c * c - b * b); m_c := 0.5 * sqrt(2 * a * a + 2 * b * b - c * c);

// Output the lengths of the medians writeln('Length of median from vertex A (m_a): ', m_a:0:2); writeln('Length of median from vertex B (m_b): ', m_b:0:2); writeln('Length of median from vertex C (m_c): ', m_c:0:2); end. ```

Replace the placeholder values for the side lengths with the actual values, and then run the program to calculate the lengths of the medians of the triangle.

0 0

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос