Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- maxch=0
- maxne=0
- summ=0
- N=int(input())
- for i in range(N):
- x=int(input())
- if x%2==0 and x>maxch:
- maxch=x
- if x%2!=0 and x>maxne:
- maxne=x
- control=int(input())
- if maxne!=0 and maxch!=0:
- summ=maxch+maxne
- else:
- summ=-1
- print('Vichislennoe kontrolnoe znachenie:', summ)
- if summ==control:
- print('Kontrol proyden')
- else:
- print('Kontrol ne proyden')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement