SHARE
TWEET

Untitled

a guest May 25th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. maxch=0
  2. maxne=0
  3. summ=0
  4. N=int(input())
  5. for i in range(N):
  6.     x=int(input())
  7.     if x%2==0 and x>maxch:
  8.         maxch=x
  9.     if x%2!=0 and x>maxne:
  10.         maxne=x
  11. control=int(input())
  12.  
  13. if maxne!=0 and maxch!=0:
  14.     summ=maxch+maxne
  15. else:
  16.     summ=-1
  17.  
  18. print('Vichislennoe kontrolnoe znachenie:', summ)
  19. if summ==control:
  20.     print('Kontrol proyden')
  21. else:
  22.     print('Kontrol ne proyden')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top