Вот все варианты решения
значения идут по порядку
"0001110101"
"0001111101"
"0010101101"
"0010110101"
"0010111101"
"0011010101"
"0011011101"
"0011101101"
"0011110101"
"0011111101"
"0101010101"
"0101011101"
"0101101101"
"0101110101"
"0101111101"
"0110101101"
"0110110101"
"0110111101"
"0111010101"
"0111011101"
"0111101101"
"0111110101"
"0111111101"
"1010101101"
"1010110101"
"1010111101"
"1011010101"
"1011011101"
"1011101101"
"1011110101"
"1011111101"
"1101010101"
"1101011101"
"1101101101"
"1101110101"
"1101111101"
"1110101101"
"1110110101"
"1110111101"
"1111010101"
"1111011101"
"1111101101"
"1111110101"
"1111111101"
//Ruby 22
for i in 0..2**10-1
s = ("000000000000000000000000000000" + i.to_s(2))[-10..-1]
next if s[-2]=="1"
a=[]
s.each_char { |c| a<<(c=="1") }
f = true
for k in 0..a.size-3
f = (f and (not a[k] or a[k+1] or a[k+2]))
end
p s if f
end
Ответ:
а = 12
Объяснение:
1). в = 4
2). а = 4 / 2 * 6 = 2 * 6 = 12
Var N,k,sum : Integer;
Begin
sum:=0;
Readln(N,k);
While N>0 do
Begin
If (N mod 10)>k then sum:=sum+(N mod k);
N:=N div 10;
end;
end.
или так
Var N,k,sum : Integer;
Begin
sum:=0;
Readln(N,k);
While N>0 do
Begin
sum:=sum+(N mod 10)*Ord((N mod 10)>k);
N:=N div 10;
end;
end.
или так
Var N,k : Integer;
Function sum(N,k : Integer) : Integer;
Begin
If (N>0) and ((N mod 10)>k) then sum:=(N mod 10)+sum(N div 10,k) else sum:=0;
end;
Begin
Readln(N,k);
Writeln(sum(N,k));
end.
Первая программа
var x,y: real;
begin
read(x);
y := x-Power(x,3)/3+Power(x,5)/5;
write('y = ', y );
end.
Вторая
var x,y: real;
begin
read(x);
y := Power(2, -x)-cos(x)+sin(2*x*y);
write('y = ', y );
end.
Третья
var x,y: real;
begin
read(x);
y := (Power(x,2)-7*x+10)/(Power(x,2)-8*x+12);
write('y = ', y );
end.
Четвертая
var x,y: real;
begin
read(x);
y := x-10*sin(x)+abs(power(x,4)-power(x,5));
write('y = ', y );
end.