<h3>1)</h3>
a = input()
b = input()
answ = ((a*a)+(b*b))
print(answ)
answ = (a**3)*(b**3)
print(answ)
<h3>2)</h3>
r = float(input("Радиус круга: "))
p = 3.14
print(r*r*p)
print(2*p*r)
<h3>3)</h3>
a, b, c = map(int, input().split())
if b >= a <= c:
print(a)
elif a >= b <= c:
print(b)
else:
print(c)
<h3>4)</h3>
<em>не забывай про табуляции</em>
def dog():
out = 0
years = int(input())
if (years <= 2):
out = years * 10.5
return out
elif (years > 2):
while(years != 2):
out += 4
years -= 1
out += 2 * 10.5
return out
def cat():
out = 0
years = int(input())
if (years <= 2):
out = years * 12.5
return out
elif (years > 2):
while(years != 2):
out += 4
years -= 1
out += 2 * 12.5
return out
if __name__ == '__main__':
pet = input()
if(pet == "собака"):
print(dog())
if(pet == "кошка"):
print(cat())
<h3>5)</h3>
со вложенными ничего не придумал
def letdothatprint():
lenght = 5
high = 7
print("* " * lenght) #Just top
while (high != 1):
print((lenght-1) * " " + "*")
high -= 1
if __name__ == '__main__':
letdothatprint()
Var x, y, i, c, s: integer;
begin
readln(x, y);
if (x < y) then
begin
for i := x to y do
begin
c := c + 1;
s := s + i;
end;
writeln('S = ', s, ' C = ', c);
end;
<span>end.
2)
const N = 10;
var a, c: array [0..N] of integer;
i: integer;
begin
for i := 0 to N do
a[i] := random(50);
for i := 0 to N do
begin
if (a[i] mod 2 = 0) then
c[i] := a[i] * a[i]
else
c[i] := 2 * a[i] * i;
end;
{Вывод массива, это для проверки, не обязательно, но если хотите...}
for i := 0 to N do
writeln('[', i, '] => ', c[i]);
<span>end.
<em>Учителям информатики очень лень говорить домашку х)</em></span></span>
<em>// PascalABC.NET 3.2, сборка 1338 от 16.11.2016</em>
begin
var x:=-3.14;
while x<=3.14 do begin
Writeln(x:5:2,' ',sqr(sin(x))+sqr(cos(x)));
x:=x+0.2
end
end.
Результат
-3.14 1
-2.94 1
-2.74 1
-2.54 1
-2.34 1
-2.14 1
-1.94 1
-1.74 1
-1.54 1
-1.34 1
-1.14 1
-0.94 1
-0.74 1
-0.54 1
-0.34 1
-0.14 1
0.06 1
0.26 1
0.46 1
0.66 1
0.86 1
1.06 1
1.26 1
1.46 1
1.66 1
1.86 1
2.06 1
2.26 1
2.46 1
2.66 1
2.86 1
3.06 1
В первом случае 2^8=256, то есть один символ кодируется 8 символами. во втором 2^5=32, то есть один символ кодируется 5 символами. 8:5=1,6. в 1,6 различаются. Вроде так
Ответ:
1- б
2
а-9
б-12
в-2
г-4
3
а - а=11 b=11
б - a=11 b=7
Объяснение:
1 - если ты поставишь ; перед else то у тебя будет ошибка, потому что else не будет определена куда ей идти.