Вопрос задан 16.02.2019 в 17:30. Предмет Информатика. Спрашивает Аманжол Аружан.

Задача по теме "Линейный алгоритм". Pascal ABC Найти площадь треугольника по известным трем

сторонам (по формуле Герона).
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Рогачёва Маша.
Program example;var a, b, c:integer;function gero(a,b,c:integer):double;var p:double;begin  p:=(a+b+c)/2;  gero:=p*(p-a)*(p-b)*(p-c);end;begin  write('Введите A'); readln(a);  write('Введите B '); readln(b);  write('Введите C'); readln(c);  writeln(gero(a,b,c));  readkey;end.
0 0
Отвечает Орынбасарова Диана.
P := a * b *c 'nj jndtn                                                                              
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Finding the Area of a Triangle in PascalABC

To find the area of a triangle in PascalABC using the formula of Heron, you can follow these steps:

1. Input the Length of the Three Sides - Declare and initialize variables for the three sides of the triangle, a, b, and c. - Prompt the user to input the values of the three sides.

```pascal Var a, b, c: integer; begin Write('Enter the length of side a: '); Readln(a); Write('Enter the length of side b: '); Readln(b); Write('Enter the length of side c: '); Readln(c); ```

2. Calculate the Semi-Perimeter - Calculate the semi-perimeter of the triangle using the formula: s = (a + b + c) / 2.

```pascal Var s: real; s := (a + b + c) / 2; ```

3. Calculate the Area using Heron's Formula - Calculate the area of the triangle using Heron's formula: area = sqrt(s * (s - a) * (s - b) * (s - c)).

```pascal Var area: real; area := sqrt(s * (s - a) * (s - b) * (s - c)); ```

4. Display the Result - Display the calculated area of the triangle.

```pascal WriteLn('The area of the triangle is: ', area:0:2); end. ```

By following these steps, you can calculate the area of a triangle in PascalABC using the formula of Heron.

0 0

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

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

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