alima1010
07.02.2023 16:21

Определить, принадлежит ли точка x отрезку [;].

var
k,n,x:real;
begin
write('=');
readln();
write('n=');
readln(n);
write('x=');
readln();
if (x>=k) and (x<=) then writeln ('yes') else writeln('no');
readln;
end.

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Aнoним01
14.03.2020 21:02

li = []

elements = 1

negative_index = 0

positive_index = 0

print("Введите 0 что бы остановить ввод")

while elements != 0:

   elements = int(input("Введите элементы списка\n"))

   li.append(elements)

li2 = li[:]

li2.sort()

length = li.__len__()

print(li)

for i in range(0, length-1):

   for j in range(length-1, 1, -1):

       if li2[i] * (-1) == li2[j]:

           for k in range(0, length-1):

               if li2[i] == li[k]:

                   negative_index = k

               if li2[j] == li[k]:

                   positive_index = k

if negative_index < positive_index:

   print("Индекс противоположного числа(1) ->", negative_index)

   print("Индекс противоположного числа(2) ->", positive_index)

elif negative_index == positive_index == 0:

   exit(0)

else:

   print("Индекс противоположного числа(1) ->", positive_index)

   print("Индекс противоположного числа(2) ->", negative_index)

P.S

Код не идеальный, но задачу выполняет

0,0(0 оценок)
Ответ:
MatveyGTR
11.09.2021 01:43

type

  base = record

     id: integer;

     ball: integer;

  end;

var

  t: text;

  a: array of array of integer;

  n: integer;

  st, tmp: string;

  err: integer := 1;

  database: base;

begin

  readln(n);

  setlength(a, n);

  for i: integer := low(a) to high(a) do

     setlength(a[i], 2);

  for i: integer := low(a) to high(a) do

  begin

     readln(st);

     tmp := st;

     delete(tmp, pos(' ', tmp, err), tmp.Length - pos(' ', tmp, err) + 1);

     database.id := strtoint(tmp);

     tmp := st;

     delete(tmp, 1, pos(' ', tmp, err));

     database.ball := strtoint(tmp);

     a[i, 0] := database.id;

     a[i, 1] := database.ball;

  end;

  var j: integer := 0;

  assign(t, 'output.txt');

  rewrite(t);

  while (j <= high(a)) do

  begin

     if (j + 1 < high(a)) and (a[j, 1] = a[j + 1, 1]) then

        if (a[j, 0] < a[j + 1, 0]) then begin

           write(t, inttostr(a[j, 0])); write(t, ' '); write(t, inttostr(a[j, 1])); writeln(t,'');

           write(t, inttostr(a[j + 1, 0])); write(t, ' '); write(t, inttostr(a[j + 1, 1])); writeln(t,'');

        end else begin

           write(t, inttostr(a[j + 1, 0])); write(t, ' '); write(t, inttostr(a[j + 1, 1])); writeln(t,'');

           write(t, inttostr(a[j, 0])); write(t, ' '); write(t, inttostr(a[j, 1])); writeln(t,'');

        end;

     if (j+1=n) then

        write(t, inttostr(a[j, 0])); write(t, ' '); write(t, inttostr(a[j, 1])); writeln(t,'');

     inc(j, 2);

  end;

  close(t);

end.

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