Mama228zx
26.11.2021 05:25

Преимущества и недостатки программных продуктов excel , access

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
elyaivanova
24.03.2023 06:58

using namespace std;

struct Treugolnik

{

int x1, y1;

int x2, y2;

int x3, y3;

};

int main()

{

Treugolnik a1;

cin >> a1.x1;

cin >> a1.x2;

cin >> a1.x3;

cin >> a1.y1;

cin >> a1.y2;

cin >> a1.y3;

float S, P, h,p;

 P = sqrt(pow(a1.x2 - a1.x1, 2) + pow(a1.y2 - a1.y1, 2))+sqrt(pow(a1.x3 - a1.x2, 2) + pow(a1.y3 - a1.y2, 2))+ sqrt(pow(a1.x3 - a1.x1, 2) + pow(a1.y3 - a1.y1, 2));

 p = 0.5*(sqrt(pow(a1.x2 - a1.x1, 2) + pow(a1.y2 - a1.y1, 2)) + sqrt(pow(a1.x3 - a1.x2, 2) + pow(a1.y3 - a1.y2, 2)) + sqrt(pow(a1.x3 - a1.x1, 2) + pow(a1.y3 - a1.y1, 2)));

 S = sqrt(p*(p - sqrt(pow(a1.x2 - a1.x1, 2) + pow(a1.y2 - a1.y1, 2*(p - sqrt(pow(a1.x3 - a1.x2, 2) + pow(a1.y3 - a1.y2, 2)))*(p - sqrt(pow(a1.x3 - a1.x1, 2) + pow(a1.y3 - a1.y1, 2)));

 h = 2 * S / sqrt(pow(a1.x2 - a1.x1, 2) + pow(a1.y2 - a1.y1, 2)); только к одной стороне  

 if (sqrt(pow(a1.x2 - a1.x1, 2) + pow(a1.y2 - a1.y1, 2)) == sqrt(pow(a1.x3 - a1.x2, 2) + pow(a1.y3 - a1.y2, 2)) == sqrt(pow(a1.x3 - a1.x1, 2) + pow(a1.y3 - a1.y1, 2)))

  cout << "ранвостронний";

 if (pow(sqrt(pow(a1.x2 - a1.x1, 2) + pow(a1.y2 - a1.y1, 2)), 2)+pow(sqrt(pow(a1.x3 - a1.x2, 2) + pow(a1.y3 - a1.y2, 2)),2)==pow(sqrt(pow(a1.x3 - a1.x1, 2) + pow(a1.y3 - a1.y1, 2)),2));

 cout << "прямоугольный";

 cout << S;

 cout << h;

 cout << P;

 return 0;

}

0,0(0 оценок)
Ответ:
фаргана4
11.02.2020 21:12

//PascalABC.NET v3.3 1633

var arr: array [1..6, 1..6] of integer;

begin

 for var i:=1 to 6 do

   for var j:=1 to 6 do

     arr[i, j]:=random(-49, 50);

 

 writeln('Исходный массив: ');

 for var i:=1 to 6 do

     arr[i].PrintLn(', ');

     

 var num:=0;

 for var i:=1 to 6 do

   if arr[i, 2] < 0 then num += 1;

 writeln('Количество отрицательных элементов второго столбца: '+num);

 

 for var i:=1 to 6 do

   for var j:=1 to 6 do

     if arr[i, j] > 0 then arr[i, j]:=-49;

 writeln('Новый массив: ');

 for var i:=1 to 6 do

     arr[i].PrintLn(', ');

end.

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота