Вопрос задан 23.02.2019 в 03:29. Предмет Информатика. Спрашивает Купин Денис.

программа в freepfscal нахождение площади треугольника, половина есть, что дальше? program dana;

uses SRT var a, b, c, P, S: real begin p:=(a+b+c)/2 S:=sqrt(p*(p-a)*(p-b)*(p-c)) помогите пожалуйста
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Стульба Ксения.
Var a, b, c, P, S: real;
begin
readln(a);
readln(b);
readln(c);
p:=(a+b+c)/2;
S:=sqrt(p*(p-a)*(p-b)*(p-c));
writeln(s);
end.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Program for Finding the Area of a Triangle in FreePascal

To find the area of a triangle using the FreePascal programming language, you can use the formula:

``` p := (a + b + c) / 2; S := sqrt(p * (p - a) * (p - b) * (p - c)); ```

Here's a breakdown of the program:

1. Declare the variables `a`, `b`, `c`, `P`, and `S` as real numbers. 2. Calculate the semi-perimeter `p` by adding the lengths of all three sides (`a`, `b`, and `c`) and dividing the sum by 2. 3. Calculate the area `S` using the formula: the square root of `p` multiplied by `(p - a)`, `(p - b)`, and `(p - c)`.

Here's the complete program:

```pascal program TriangleArea; uses Math; var a, b, c, p, S: real; begin // Input the lengths of the triangle's sides writeln('Enter the lengths of the triangle sides:'); readln(a, b, c);

// Calculate the semi-perimeter and area p := (a + b + c) / 2; S := sqrt(p * (p - a) * (p - b) * (p - c));

// Output the area writeln('The area of the triangle is: ', S:0:2); end. ```

To use this program, you need to input the lengths of the triangle's sides, and it will calculate and display the area of the triangle.

I hope this helps! Let me know if you have any further questions.

0 0

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

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

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