Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -"- coding: utf-8 -"-
- N = 0
- R1,R=0,0
- x,m1,m2 = 1,0,0
- while x != 0 :
- x = int(input('x = '))
- if x > 0 :
- N += 1
- if (x > m1) and (x > m2) and (x * m2) % 6 == 0 :
- m1 = x
- if (m2 < x) and (x < m1) and (m1 * x) % 6 == 0 :
- m2 = x
- if (x == m1) and (m1 * x) % 6 == 0 :
- m2 = x
- if x == 0 :
- R = m1*m2
- R1 = int(input('R1 = '))
- print('Получено ' + str(N) +' чисел')
- print('Полученное контрольное значение: ' +str(R1))
- print('Вычисленное контрольное значение: ' +str(R))
- if R1 == R :
- print("Контроль пройден")
- else:
- print("Контроль не пройден")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement