Advertisement
Guest User

Untitled

a guest
May 24th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. # -"- coding: utf-8  -"-
  2. N = 0
  3. R1,R=0,0
  4. x,m1,m2 = 1,0,0
  5. while x != 0 :
  6.   x = int(input('x = '))
  7.   if x > 0 :
  8.     N += 1
  9.     if (x > m1) and (x > m2) and (x * m2) % 6 == 0 :
  10.       m1 = x
  11.     if (m2 < x)  and (x < m1) and (m1 * x) % 6 == 0 :
  12.       m2 = x
  13.     if (x == m1) and (m1 * x) % 6 == 0 :
  14.       m2 = x    
  15. if x == 0 :
  16.   R = m1*m2
  17. R1 = int(input('R1 = '))
  18. print('Получено ' + str(N) +' чисел')
  19. print('Полученное контрольное значение: ' +str(R1))
  20. print('Вычисленное контрольное значение: ' +str(R))
  21. if R1 == R :
  22.     print("Контроль пройден")
  23. else:
  24.     print("Контроль не пройден")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement