SHARE
TWEET

Untitled

a guest Jul 17th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. x = []
  2. N = int(input())
  3. k = int(input())
  4. for i in range(1, N):
  5.     x.append(i)
  6. print(x)
  7.  
  8.  
  9. if k>N:
  10.     i = k - N
  11. else:
  12.     i = k
  13.    
  14.    
  15. while len(x) > 1:
  16.     print(x.pop(i)) #УБИВАЕТ ПООЧЕРЕДНО ИГРОКОВ
  17.     i = (i + k - 1) % len(x)
  18. print('Выиграл', x[0])
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