def resistance():
r1 = float(input('R1 = '))
r2 = float(input('R2 = '))
r3 = float(input('R3 = '))
return 1/(1/r1 + 1/r2 + 1/r3)
6 уникальных строк
["bbaaaabbaaaa", "baaaabbaaaab", "aaaabbaaaabb", "aaabbaaaabba", "aabbaaaabbaa", "abbaaaabbaaa"]
Программа на Ruby 22
s = "abbaaaabbaaa"
a = []
for i in 0..s.size
s = s[1..-1] + s[0..0]
a << s if not a.include?(s)
end
p a
p a.size
Var a, b, c, d, i : integer;
Begin
read(a);
read(b);
read(c);
read(d);
for i := a to b do
if (i mod c = d) then
writeln(i);
writeln();
for i := a to b do
if frac(sqrt(i)) = 0 then
writeln(i);
writeln();
for i := 2 to a-1 do
if a mod i = 0 then begin
writeln(i);
exit;
end;
End.
Получаем 2 уравнения:
1) 3x+2=4, где 3x+2>0, 3x>-2; x>-2/3
3x=2; x=2/3;
2/3>-2/3 - верно
2) -3x-2=4, где x<-2/3
3x=-6
x=-2,
-2<-2/3 - верно
2 корня: -2 и 2/3
Ответ: б