def translation_of_lengths(n, m):
inch = 2.54
if m == 'duim':
print("{} inch = {}cm ".format(n, (n * inch)))
if m == 'cm':
print("{} cm = {} inch ".format(n, (round(n / inch, 2
translation_of_lengths(5, 'duim')
translation_of_lengths(120, 'cm')
def even_numbers(s):
s_mas = s.split()
if len(s_mas) != 6:
print("\tYou have entered not 6 numbers!")
print(s_mas)
else:
x = sum(int(i) for i in s_mas if int(i) >= 0 if int(i) % 2 == 0)
print("The sum of even numbers {}".format(x))
a = input("Numbers: ")
even_numbers(a)
def procent(x, y):
print('{}% from the number {} = {}'.format(x, y, (x / 100) * y))
procent(55, 120)
var a:STRING;
i,n,j,k,x,z,y:integer; d:boolean;
begin
readln(n);
read(a);
d:=false;
if (n=1)and (a='8') then d:=true;
if n=2 then begin
x:=ord(a[1]) - 48;
y:=ord(a[2]) - 48;
if((x*10+y) mod 8=0) or
((y*10+x) mod 8=0) then d:=true;
end
else
for i:=1 to N-2 do
for j:=i+1 to N-1 do
for k:=i+2 to N do
x:=ord(a[i])-48;
y:=ord(a[j])-48;
z:=ord(a[k])-48;
if((x*4+y*2+z) mod 8=0) or
((y*4+x*2+z) mod 8=0) or
((y*4+z*2+x) mod 8=0) or
((x*4+z*2+y) mod 8=0) or
((z*4+y*2+x) mod 8=0) or
((z*4+x*2+y) mod 8=0) then d:=true;
end; end;
if d then write('YES') else write('NO');
end.
def translation_of_lengths(n, m):
inch = 2.54
if m == 'duim':
print("{} inch = {}cm ".format(n, (n * inch)))
if m == 'cm':
print("{} cm = {} inch ".format(n, (round(n / inch, 2
translation_of_lengths(5, 'duim')
translation_of_lengths(120, 'cm')
def even_numbers(s):
s_mas = s.split()
if len(s_mas) != 6:
print("\tYou have entered not 6 numbers!")
print(s_mas)
else:
x = sum(int(i) for i in s_mas if int(i) >= 0 if int(i) % 2 == 0)
print("The sum of even numbers {}".format(x))
a = input("Numbers: ")
even_numbers(a)
def procent(x, y):
print('{}% from the number {} = {}'.format(x, y, (x / 100) * y))
procent(55, 120)
var a:STRING;
i,n,j,k,x,z,y:integer; d:boolean;
begin
readln(n);
read(a);
d:=false;
if (n=1)and (a='8') then d:=true;
if n=2 then begin
x:=ord(a[1]) - 48;
y:=ord(a[2]) - 48;
if((x*10+y) mod 8=0) or
((y*10+x) mod 8=0) then d:=true;
end
else
begin
for i:=1 to N-2 do
for j:=i+1 to N-1 do
for k:=i+2 to N do
begin
x:=ord(a[i])-48;
y:=ord(a[j])-48;
z:=ord(a[k])-48;
if((x*4+y*2+z) mod 8=0) or
((y*4+x*2+z) mod 8=0) or
((y*4+z*2+x) mod 8=0) or
((x*4+z*2+y) mod 8=0) or
((z*4+y*2+x) mod 8=0) or
((z*4+x*2+y) mod 8=0) then d:=true;
end; end;
if d then write('YES') else write('NO');
end.