div:last-child {padding-bottom: 0;border: none;}.mass_comments_action {display: none;}.comm-box {margin-bottom: 20px;}.comm-title {float: left;font-size: 22px;font-weight: 700;color: #333;}.full-title {font-size: 22px;font-weight: 700;color: #333;margin-bottom: 20px;}.comm-user {float: right;font-size: 14px;padding-top: 5px;}.comm-bott {font-size: 17px;line-height: 24px;}.comm-bott > div, .answers .element .content {word-wrap: break-word;font-size: 18px;line-height: 24px;font-weight: 400;color: #000;}#news_set_sort {float: right;margin-top: -5px;}.side-title {color: #333;font-weight: 800;text-align: center;margin-bottom: 15px;}.side-btnbox {text-align: center;}.btn.bg-blue {background-color: #4fb3f6;}#moreres {background: #fff;color: #000;font-size: 14px;text-transform: none;box-shadow: none;border-radius: 17px;border-bottom: 2px solid #e9e9e9;}#moreres.lds-ring-loader {opacity: 0.5;cursor: default;}#moreres .lds-ring {display: inline-block;position: absolute;width: 35px;height: 35px;}#moreres .lds-ring div {box-sizing: border-box;display: block;position: absolute;width: 30px;height: 30px;margin: 3px;border: 3px solid #333;border-radius: 50%;animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;border-color: #333 transparent transparent transparent;}#moreres .lds-ring div:nth-child(1) {animation-delay: -0.45s;}#moreres .lds-ring div:nth-child(2) {animation-delay: -0.3s;}#moreres .lds-ring div:nth-child(3) {animation-delay: -0.15s;}@keyframes lds-ring {0% {transform: rotate(0deg);}100% {transform: rotate(360deg);}}
profile
Опубликовано 6 лет назад по предмету Информатика от EVOSTATION

СРОЧНО ПОМОГИТЕ ИСПРАВИТЬ ОШИБКУ. 30 БАЛЛОВ

Задача: "Написать модуль для вычисления площади треугольника по формуле Герона(она ниже представлена).

Основная ПМ:

program GERON;
uses crt,formula;
var S,p:real;
a,b,c:real;
begin clrscr;
write('a=');readln(a);
write('b=');readln(b);
write('c=');readln(c);
resh(S,p,a,b,c);
write('S=',S:12:2);
readkey
end.

Модуль:

unit formula;
interface
procedure resh(a,b,c:real;var p,S:real);
implementation
procedure resh(a,b,c:real;var p,S:real);
begin
p:=(a+b+c)/2;
S:=sqrt(p*(p-a)*(p-b)*(p-c));
end;
end.

Суть в том что написанно все правельно но при вводе чисел ничего нет ⇔ (S=0) программа не работает,помогите исправить ошибку.

  1. Ответ
    Ответ дан yudinzhenya2014
    p:=(a+b+c)/2; это модуль
    resh(S,p,a,b,c); это пм
    1. Ответ
      Ответ дан yudinzhenya2014
      учитель над тобой поржать хочет либо умнож на число пи пм и модуль
    2. Ответ
      Ответ дан EVOSTATION
      нет
    3. Ответ
      Ответ дан EVOSTATION
      мне нужно ввести стороны
    4. Ответ
      Ответ дан EVOSTATION
      и по этой формулы надо что бы вывелась площадь
    5. Ответ
      Ответ дан EVOSTATION
      но выводится 0
Самые новые вопросы