Мэрисельда
30.05.2020 14:16

Дайте мне код (командную строку) вируса который каждые 3-10 часов писал на экране компьютера:
иди гуляй .Другу​

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
marinagrizhuk
07.06.2020 07:57
Public static double CosineBetweenVectors(double[] a, double[] b)
        {
            if (a.Length != b.Length || a.Length == 0) throw new Exception("не верные параметры");

            double ab = 0;
            double a_length = 0;
            double b_length = 0;
            for (var i = 0; i < a.Length; i++)
            {
                ab += a[i] * b[i];
                a_length = a[i] * a[i];
                b_length = b[i] * b[i];
            }

            if (a_length * b_length == 0) throw new Exception("Нулевые вектора");

            return ab / Math.Sqrt(a_length) / Math.Sqrt(b_length);
        }
0,0(0 оценок)
Ответ:
MeucaH123aksi
18.11.2022 23:01

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