
программа в 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)) помогите пожалуйста

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

begin
readln(a);
readln(b);
readln(c);
p:=(a+b+c)/2;
S:=sqrt(p*(p-a)*(p-b)*(p-c));
writeln(s);
end.



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.


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








Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili