Хохлова Иванович
?>

Составить программу, , нужно ! пятиугольник abcde задан координатами своих вершин (x1, y1)(x2, y2)(x3, y3)(x4, y4)(x5, y5) соответственно. найти площадь этого пятиугольника используя в качестве подпрограммы a) функцию

Информатика

Ответы

mashumi2170

#include < iostream>

using namespace std;

 

struct my{

    int x;

    int y;

}

 

void s_size() ;

 

int main()

{    my my_struct = new my[5];

    for(int i =0 ; i< 5; i++)

{

  cin > > my_struct[i].x;

  cin > > my_struct[i].y;

 

s_size();

}

 

s_size()

{

  double s = 0.5*((my_struct[0].x*my_struct[1]..x *my_struct[0].y))*((my_struct[1].x * my_struct[2]..x*my_struct[1].y))*((my_struct[2].x * my_struct[3]..x*my_struct[2].y))*((my_struct[3].x * my_struct[4].y)- (my_struct[4].x*my_struct[3].y));

cout < < s ;

}

manyugina1
Const    letters = ['a'..'z', 'a'..'z'];   lineends = [#13, #10, #0, '.'];   max_len = 255; var    txt: array [0..max_len] of char;   bnd: array [0..max_len, 0..1] of integer;   tsz, bsz: integer; // размеры массивов   isletter, isword, f1, f2: boolean;   i, j: integer; begin   repeat     read(txt[tsz]);     // определение границ слов         isletter : = txt[tsz] in letters;     if isletter and not isword then       bnd[bsz, 0] : = tsz;     if isword and not isletter then begin       bnd[bsz, 1] : = tsz;       bsz : = bsz + 1;     end;           isword : = isletter;     tsz : = tsz + 1;   until txt[tsz-1] in lineends;       if bsz > 1 then begin       for i : = 0 to bsz-2 do begin       j : = 0; f2 : = true;       f1 : = (bnd[bsz-1, 1] - bnd[bsz-1, 0]) = (bnd[i, 1]-bnd[i, 0]); // совпадение длин               while (j < bnd[i, 1] - bnd[i, 0]) and f2 do begin         f1 : = f1 and (txt[bnd[i, 0] + j] = txt[bnd[bsz-1, 0] + j]);         f2 : = f2 and (lowcase(txt[bnd[i, 0] + j]) = chr(ord('a') + j));         j : = j + 1;       end;               // вывод       if f2 and not f1 then begin         for j : = bnd[i, 0] to bnd[i, 1] - 1 do           write(txt[j]);         writeln;       end;     end;   end; end.
qcrv15312
Var   n, i, j, askthemountains: longint;   a: array of longint;   fl: text; begin   assign(fl, 'input.txt');   reset(fl);   readln(fl, n);   setlength(a, n);   for i : = 0 to (n - 1) do     readln(fl, a[i]);   close(fl);   assign(fl, 'output.txt');   rewrite(fl);       for i : = 0 to n - 1 do     for j : = i to n - 1 do       if (a[i] > a[j]) then       begin         askthemountains : = a[i];         a[i] : = a[j];         a[j] : = askthemountains;       end;   for i : = 0 to n-1 do     writeln(fl, a[i]);   close(fl); end.

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

Составить программу, , нужно ! пятиугольник abcde задан координатами своих вершин (x1, y1)(x2, y2)(x3, y3)(x4, y4)(x5, y5) соответственно. найти площадь этого пятиугольника используя в качестве подпрограммы a) функцию
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

djevgen
Semenova1719
Вадим
kotovayaanastasia2069
Olesyamilenina8
ainud
Yeliseeva Verevkin864
ksen1280
karpov68
evavard
nebo2020
Рожнов
vsnimschikov391
Elvira-Natalya
shoko91