В
Все
М
Математика
А
Английский язык
Х
Химия
Э
Экономика
П
Право
И
Информатика
У
Українська мова
Қ
Қазақ тiлi
О
ОБЖ
Н
Немецкий язык
Б
Беларуская мова
У
Українська література
М
Музыка
П
Психология
А
Алгебра
Л
Литература
Б
Биология
М
МХК
О
Окружающий мир
О
Обществознание
И
История
Г
Геометрия
Ф
Французский язык
Ф
Физика
Д
Другие предметы
Р
Русский язык
Г
География
tat2119
tat2119
01.02.2023 02:42 •  Информатика

1)Необходимо подготовить логотип компании для публикации на сайте. Специализация данного сайта — охота. Какую цветовую модель необходимо использовать?

А)RGB
Б)RGB2
В)CMYK

2)Яркость:0
Red:0
Green:1
Blue:1
Цвет:

Показать ответ
Ответ:
Adilka11
Adilka11
31.05.2022 14:54
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;

int main() {
   float a,b,c,p,s;
   struct   {
           float ax,ay,bx,by,cx,cy;
     } ABC;
   cout<<" задайте координаты точек"<<endl;
   cout<<" ax "<<" ay "<<" bx "<<" by "<<" cx "<<" cy";
   cout<<endl;
   cin>>ABC.ax>>ABC.ay>>ABC.bx>>ABC.by>>ABC.cx>>ABC.cy;
// вычисление длин сторон
   a=sqrt(pow((ABC.bx-ABC.ax),2)+pow((ABC.by-ABC.ay),2));
   b=sqrt(pow((ABC.cx-ABC.bx),2)+pow((ABC.cy-ABC.by),2));
   c=sqrt(pow((ABC.cx-ABC.ax),2)+pow((ABC.cy-ABC.ay),2));
   p=(a+b+c)/2;
// проверка, что можно составить треугольник
   if (((p-a)>0) && ((p-b)>0) && ((p-c)>0))
   cout<<"точки образуют треугольник"<<endl;
   else  cout<<"точки лежат на одной прямой"<<endl;

   system("pause");
   return(0);
}
0,0(0 оценок)
Ответ:
kurilen
kurilen
17.06.2021 09:05

С++20

#include <iostream>#include <vector>class Point {public:    int x, y;    Point() = default;    Point(const Point &) = default;    Point(int _x, int _y) : x(_x), y(_y) {}    Point operator + (const Point& p) const {        return Point {x + p.x, y + p.y};    }    Point operator - (const Point& p) const {        return Point {x - p.x, y - p.y};    }    std::vector<Point> operator & (const Point& p) const {        return std::vector<Point> {                Point {x + p.x, y + p.y},                Point {x - p.x, y + p.y},                Point {x + p.x, y - p.y},                Point {x - p.x, y - p.y},                Point {x + p.y, y + p.x},                Point {x - p.y, y + p.x},                Point {x + p.y, y - p.x},                Point {x - p.y, y - p.x},        };    }    static Point max (const Point& p1, const Point& p2) {        return Point {std::max(p1.x, p2.x), std::max(p1.y, p2.y)};    }    static Point min (const Point& p1, const Point& p2) {        return Point {std::min(p1.x, p2.x), std::min(p1.y, p2.y)};    }    [[nodiscard]] int distance_to_by_ch (const Point & p) const {        return std::max(std::abs(p.x - x), std::abs(p.y - y));    }    [[nodiscard]] int distance_to_by_m (const Point & p) const {        return std::abs(p.x - x) + std::abs(p.y - y);    }    friend std::ostream &operator << (std::ostream &os, Point const &p) {        return os << "(" << p.x << ";" << p.y << ")";    }    Point & operator = (const Point &) = default;    bool operator == (const Point & p) const {        return x == p.x && y == p.y;    }};class Horse {public:    const Point p;    explicit Horse (const Point position) : p(position) { }    [[nodiscard]] bool can_I_kill_this_guy (const Point & m) const {        auto field = p & Point{2, 3};        return std::find(field.begin(), field.end(), m) != field.end();    }};std::istream &to_number(std::istream &stream) {    char ch;    do {        ch = stream.get();    }    while (!isalpha(ch));    if (isupper(ch)) ch -= 16; else ch -= 48;    stream.putback(ch);    return stream;}int main () {    Point horse_p{}, stranger_p{};    std::cin >> horse_p.x >> to_number >> horse_p.y;    std::cin >> stranger_p.x >> to_number >> stranger_p.y;    Horse jack(horse_p);    std::cout << "I am a Horse placed on " << jack.p << ". "              << "Can I kill those guy on " << stranger_p << "? "              << "-> " << std::boolalpha << jack.can_I_kill_this_guy(stranger_p); }
Поле шахматной доски определяется парой – буква и цифра. Буква (a … h) означает горизонталь при счет
Поле шахматной доски определяется парой – буква и цифра. Буква (a … h) означает горизонталь при счет
Поле шахматной доски определяется парой – буква и цифра. Буква (a … h) означает горизонталь при счет
0,0(0 оценок)
Популярные вопросы: Информатика
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота