<em>// PascalABC.NET 3.2, сборка 1416 от 26.03.2017</em>
<em>// Внимание! Если программа не работает, обновите версию!</em>
function s1(a:array of integer):=a.Where(x->x mod 5=0).Sum;
function s2(a:array of integer):=a.Where(x->x.IsOdd and (x<0)).Sum;
begin
var a:=ArrRandom(80,-100,100); a.Println; Writeln;
Writeln('S1=',s1(a),', S2=',s2(a))
end.
<u>Пример</u>
81 85 -59 97 98 65 -59 -46 -69 -70 -45 -85 -5 -88 30 -30 -60 33 52 -59 79 70 -40 -51 -5 97 78 11 65 -88 -45 78 -90 90 94 0 6 4 -8 -40 49 19 58 -35 43 9 9 24 -59 73 77 31 -59 81 38 -89 24 92 1 -99 87 31 -10 -82 75 -23 -96 5 -81 -71 65 36 -60 -8 -7 -41 -89 95 7 87
S1=25, S2=-1135
X mod 7 <> 0
y <> 0
(x>-5) and (x<10)
(x>=-1) and (x<=1)
Program z1; Var n:integer;Begin write('Введите число - '); readln(n); while n>9 do n:=n div 10; if (n mod 2= 0) then writeln('Четна') else writeln('Нечетна');<span>End.</span>
#Python 3.6.0
a, b = int(input()), int(input())
while a!=b:
if (a//2>=b) and (a%2 == 0):
print ('Разделить на 2')
a//=2
else:
print ('Вычесть 1')
a-=1