Demo entry 5290678

27

   

Submitted by anonymous on Jun 14, 2016 at 16:48
Language: Python 3. Code size: 683 Bytes.

n = int(input())

smallest = 1001
six = 1002
two = 1002
three = 1002

for x in range(n):
    f = int(input())
    if f%6==0 and f<six:
        if six<smallest: 
            smallest=six
            """Нужна ли эта проверка и замена?"""
        six=f
    elif f%2==0 and f%6!=0 and f<two:
        two=f
    elif f%3==0 and f%6!=0 and f<three:
        three=f
    elif f<smallest:
        smallest=f

result = min(smallest*six, two*three, six*two, six*three)
if six==1002 or (three==1002 and two==1002):
    result=0

r = int(input())

k = "Вычисленное контрольное значение: %s" % (result)
print(k)

if r==result:
    print("Контроль пройден")
else:
    print("Контроль не пройден")

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).