Riiiiiii
22.05.2021 23:35

Создать блок схему по готовой программе из visual basic

sub pr1()
dim y as single, x as single, z as single, sum1 as single, sum2 as single, i as integer
i = 2

for x = 1.5 to 2.5 step 0.1
z = sin(x) * cos(x)
y = sqr(x + 1.7) - 0.5 * x
i = i + 1

if z < 1 then
sum1 = sum1 + z
end if

if y > 1 and y < 3 then
sum2 = sum2 + y
end if

sheets("лист1").cells(i, 1) = i
sheets("лист1").cells(i, 2) = y
sheets("лист1").cells(i, 3) = z

next x

sheets("лист1").cells(3, 4) = sum1
sheets("лист1").cells(3, 5) = sum2

end sub

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
thedesxte
16.03.2022 18:35

 2)

Program Massiv1;

var a:array[1..10] of real;

       i:integer;

       s:real;

begin

      clrscr;

       write('Введите элементы массива: ');

 

      s:=0;

 

      for i :=1 to 10 do

             begin

                  readln(a[i]);   

 

                  if  (a[i]>0) then s:=s+1;

 

           end;

writeln;

for i :=1 to 10 do     writeln(a[i]:3:3);   

 writeln('Количество положительных элементов:',s);

 readkey;

 

 end.

 

 

 3)

Program Massiv2;

var a:array[1..10] of integer;

       i,b:integer;  

  begin

       clrscr;

       b:=2; 

       for i :=1 to 10 do

             begin

                a[i]=i+b;

                 b:=b+1; 

 

                 write(a[i]:2); 

 

             end;   

readkey;

end.

 

 

 

 

 

0,0(0 оценок)
Ответ:
Lopkrtjvbbcx
02.03.2020 16:50

1) 

Const
n=10;

Var
a:array [1..n] of integer;
i,max:integer;

begin
Write('Введите массив: ');
For i:=1 to n do
Read(a[i]);
Readln;

max:=a[1];
For i:=1 to n do
If a[i]>max
Then
max:=a[i];

Writeln('Максимальный элемент - ',max);
Readln;
end.

2)  хз

3) 

const
n = 100;
var
arr: array[1..n] of integer;
i, m, qty: byte;
begin
write('Количество элементов массива: ');
readln(m);
write('Элементы массива через пробел: ');
for i:=1 to m do
read(arr[i]);
readln;

qty := 0;
i := 2;
while i < m do
if (arr[i] > arr[i-1]) and (arr[i] > arr[i+1]) then begin
qty := qty + 1;
i := i + 2
end
else
i := i + 1;

writeln('Кол-во элементов, которые больше соседей: ', qty);

readln;
end.

Вроде как-то так

 

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