movamrr
28.12.2020 07:18

Хелп хелп хелп хелп хелп хелп плех


Хелп хелп хелп хелп хелп хелп плех

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
али421
02.07.2020 03:09

const

      MAX = 20;

    var

      s:string;

      stack:array[1..MAX] of string;

      top:integer;

      i:byte;

   

    procedure Push(ch:string);

    begin

      if top>=MAX then WriteLn('Stask full')

      else

      begin

        stack[top]:=ch;

        top:=top+1;

      end;

    end;

   

    function Pop:string;

    begin

      top:=top-1;

      if top<1 then

      begin

        WriteLn('Stack underflow');

        top:=top+1;

      end

      else Pop := stack[top];

    end;

begin

top:=1;

s:='<asdf<asdf>asdf>';//правильная строка

for i:=1 to length(s) do

begin

   if s[i]='<' then Push('<');

   if s[i]='>' then

       if Pop()<>'<' then WriteLn('Ошибка!');

end;

if top<>1 then WriteLn('Ошибка!');

top:=1;

s:='<asdf<asdfasdf>';//не правильная строка

for i:=1 to length(s) do

begin

   if s[i]='<' then Push('<');

   if s[i]='>' then

     if Pop()<>'<' then WriteLn('Ошибка!');

end;

if top<>1 then WriteLn('Ошибка!');

end.

Объяснение:

0,0(0 оценок)
Ответ:
tyrykina0115
20.07.2020 14:17

K1 = int(input())

M = int(input())

K2 = int(input())

P2 = int(input())

N2 = int(input())

if M != 1:

   for i in range(1,1000):

       if i!=0 and N2==((K2-1)//i)+1:

           P1 = (((K1-1)//i)//(M-1))+1

           N1=(((K1-1)//i)%(M-1))  

if M == 1:

   N1 = 1

   for i in range(1,1000):

       if i!=0:

           while K1 % i != 0:

               K1 = K1 + 1

           P1 = (K1//i)

if K2 < P2 * N2 or N2 > M or K2 // P2 < M:

   P1 = -1

   N1 = -1

if P2 == 1 and N2 == 1:

   P1 = -1

print(P1, N1)

Объяснение:

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