М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации

РЕШИТЬ ЗАДАЧУ ПО ИНФОРМАТИКЕ(ПАСКАЛЬ надо ещё блок схему)

Задача 1.

Дана сторона равностороннего треугольника. Найти его периметр.

Задача 2.

N школьников делят K яблок поровну, не делящийся остаток остается в корзинке. Сколько яблок достанется каждому школьнику?​

👇
Открыть все ответы
Ответ:
ELINA98736
ELINA98736
26.12.2021
Var s:string;
n,k,i:integer;
begin
for n:=1 to 2 do
 begin
 writeln('Введите строку ',n,':');
 readln(s);
 k:=0;
 for i:=1 to length(s) do
  begin
  case s[i] of
   '[': k:=k+1;
   ']': k:=k-1;
   end;
  end;
 if k=0 
 then writeln('В строке ',s,' количество [ и ] одинаково')
 else writeln('В строке ',s,' количество [ и ] не одинаково');
 end;
end.

Пример:
Введите строку 1:
c:=a[imax,j]; a[imax,j]:=a[imin,j]; a[imin,j]:=c
В строке c:=a[imax,j]; a[imax,j]:=a[imin,j]; a[imin,j]:=c количество [ и ] одинаково
Введите строку 2:
Просто [ пример ]] со [[ скобками
В строке Просто [ пример ]] со [[ скобками количество [ и ] не одинаково
4,7(67 оценок)
Ответ:
mirann2hsjb
mirann2hsjb
26.12.2021

A while loop is a type of loop that runs as long as a logical condition is True. When the logical condition becomes False, the loop stops running. The general form of a while loop in Python is below:

while <logical_condition>: <code>

The keyword while must be included, as well as a <logical_condition> which can be evaluated as True or False. The <code> after the while statement must be indented. Each line of code runs in the while loop needs to be indented the same number of spaces. (Many code editors, including Jupyter notebooks, auto-indent after a whilestatement) If you add indentation manually, four space spaces is the Python standard.

An example of a while loop is below:

In [1]:

i = 0 while i<4: print(i) i = i+1

The first line i=0 creates the variable i and assigns it the value 0. The next line declares the logical condition needed to keep the loop running. The statement i<4 is True or False depending on the variable i. Since i=0, the statement i<4 is Trueand the while loop starts to run. The code inside while the loop prints the value of i then increases iby 1. When i=4, the statement i<4 is False and the while loop ends.

4,5(98 оценок)
Это интересно:
Новые ответы от MOGZ: Информатика
Полный доступ к MOGZ
Живи умнее Безлимитный доступ к MOGZ Оформи подписку
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ