Yandarbieva1
04.07.2022 12:01

Каким будет результат выполнения цикла


Каким будет результат выполнения цикла

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Ира1656
02.11.2022 06:56
Uses graphABC;
const
    cx = 200;
    cy = 200;
    radius = 150;

procedure Chandelier(PenColor, BrushColor: Color);
begin
    SetPenColor(PenColor);
    SetBrushColor(BrushColor);
    Line(cx, 0, cx, cy - radius);
    FillPie(cx, cy, radius, 0, 180);
    Ellipse(cx - radius, cy - 30, cx + radius, cy + 30);
end;

procedure Dark();
begin
    ClearWindow(clBlack);
    
    Chandelier(clGreen, clDarkGreen);
    
    SetBrushColor(clBlack);
    SetFontColor(clWhite);
    TextOut(cx - 30, 2 * cy - 50, 'False');
end;

procedure Light();
begin
    ClearWindow(clSilver);
    
    SetBrushColor(clLightGoldenrodYellow);
    FillPie(cx, cy - radius div 2, 3 * cx, 210, 330);
    
    Chandelier(clGreen, clLime);
    
    SetBrushColor(clYellow);
    FillCircle(cx, cy - radius div 2, 35);
    
    SetBrushColor(clLightGoldenrodYellow);
    SetFontColor(clBlack);
    TextOut(cx - 30, 2 * cy - 50, 'True');
end;

procedure DrawLamp(state: Boolean);
begin
    if state then
        Light()
    else Dark();
end;

var
    LampState: Boolean;
    key: Char;

begin
    SetWindowSize(2 * cx, 2 * cy);
    SetFontSize(20);
    LampState := False;
    
    repeat
        DrawLamp(LampState);
        key := ReadChar();
        if key = 'h' then
            LampState := not LampState;
    until key = #27;
end.
0,0(0 оценок)
Ответ:
polinashevchen4
14.06.2021 20:40
Var
    x1, x2, x3, x4, y1, y2, y3, y4: real;

function VectorLength(x1, y1, x2, y2: real): real;
begin
    VectorLength := sqrt(sqr(x1 - x2) + sqr(y1 - y2));
end;

function VectorSlope(x1, y1, x2, y2: real): real;
begin
    VectorSlope := (y1 - y2) / (x1 - x2);
end;

begin
    readln(x1, y1);
    readln(x2, y2);
    readln(x3, y3);
    readln(x4, y4);
    
    if (VectorLength(x1, y1, x2, y2) = VectorLength(x4, y4, x3, y3))
    and (VectorSlope(x1, y1, x2, y2) = VectorSlope(x4, y4, x3, y3)) then
        writeln('Yes')
    else writeln('No');
end.
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота