Sub My_VBA()
s = 0
Do
n = InputBox("введите число, 0 - конец ввода")
If n > 0 Then s = s + n
Loop Until n = 0
MsgBox "Сумма положительных чисел равна " + Str(s)
End Sub
Блок-схема во вложении
Var
min, summ, count, maxn, max, i:integer;
begin
summ:=0;
count:=0
maxn:=0;
writeln('Введите диапазон чисел: ');
read(min, max);
for i:=min to max do
begin
if ((i mod 2) = 0) then
summ:=summ+i
else
begin
if (i>maxn) then
maxn:=i;
count:=count+1;
end;
end;
if (count>10) then
writeln(maxn)
else
writeln(summ);
end.
Если нужны какие-то объяснения - пиши в комментарии.
Вправо
нц 3 раза
нц 3 раза
закрасить, вниз
кц
вправо
кц
#include<iostream>
using namespace std;
int main()
{
int A;
cin >> A;
int Min = A;
int Max = A;
while(A)
{
cin >> A;
if (Max < A && A!=0) Max = A;
if (Min > A && A!=0) Min = A;
}
cout <<"Min = "<<Min<<"\n";
cout <<"Max = "<<Max<<"\n";
cout <<"Min - Max = "<<Min-Max<<"\n";
return 0;
}