Irisha1986
23.05.2021 09:00

Программа по информатике 9 класс нужно составить блок-схему данной программы

Const

N = 5;

Var

A,B:array[1..N] of integer;

i,j:integer;

Begin

j:=0;

Write('Массив A(',N,'):');

For i:= 1 to N do

Begin

A[i]:=random(N);

Write(' ',A[i]);

if A[i] mod 2 = 0 then

Begin

j:=j+1;

B[j]:=i;

End;

End;

WriteLn;

Write('Массив B(',j,'):');

For i:= 1 to j do

Write(' ',B[i])

End.

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Elbek11ee
17.09.2022 01:29
Const Sz = 1000; var   a: array [1..Sz] of integer;  a1: array [1..Sz] of integer;  a2: array [1..Sz] of integer;  a3: array [1..Sz] of integer;  M: integer;  N: integer;  i: integer;  k: integer;begin  read(M);  readln(N);  for k:=1 to N do begin    read(a[i]);    readln(a1[i]);    if (a[i]<>0) then a3[i]:=1 else a3[i]:=0;    end;  for k:=1 to N do begin  if(a3[i]<>0) then begin  for i:=1 to i do begin  if(a3[k]=0) then d[i]:=1;  if (a2[k]=i) then d[k]:=0;   end;   writeln(a3[i])  end;end;end.
вроде так
0,0(0 оценок)
Ответ:
regionagustin
09.05.2021 01:45

program restoran;

var

 first, second, third, fourth: integer;

 first_tip, second_tip, third_tip, fourth_tip, amount: real;

begin

 amount := 0;

 read(first, second, third, fourth);

 first_tip := first / 100 * 15;

 second_tip := second / 100 * 15;

 third_tip := third / 100 * 15;

 fourth_tip := fourth / 100 * 15;

 amount := first_tip + second_tip + third_tip + fourth_tip;

 write(amount);

end.

Объяснение:

program restoran;  // Название программы

var

 first, second, third, fourth: integer;  // Создание целочисленных переменных, отвечающих за счёт, на который пообедали гости

 first_tip, second_tip, third_tip, fourth_tip, amount: real;  // Создание вещественных (с плавающей точкой) переменных, отвечающих за размер чаевых и сумму чаевых соответственно

begin  // Начало программы

 amount := 0;  // Сумма = 0

 read(first, second, third, fourth);  // Считываем значения счетов каждого гостя с клавиатуры

 first_tip := first / 100 * 15;  // Чаевые с первого счета

 second_tip := second / 100 * 15;  // Чаевые со второго счета

 third_tip := third / 100 * 15;  // Чаевые с третьего счета

 fourth_tip := fourth / 100 * 15;  // Чаевые с четвертого счета

 amount := first_tip + second_tip + third_tip + fourth_tip;  // Сумма чаевых

 write(amount);  // Вывод суммы

end. // Конец программы

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