Created
February 5, 2017 15:57
-
-
Save MichelCF/3ee0469914b223109f7426c0871251af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Sat Feb 4 16:00:27 2017 | |
@author: Caiafa | |
""" | |
def main(): | |
homens = int(input()) | |
marca = homens | |
salto = int (input()) | |
lista_homens = range(homens) | |
while (True): | |
for posicao in lista_homens[::salto]: | |
homens =homens -1 | |
print (posicao) | |
print ((posicao +salto)-marca) | |
if homens ==0: | |
print ("posicao : ",lista_homens[posicao]) | |
return 0 | |
elif lista_homens.index(posicao) + salto > marca: | |
posicao =(posicao +salto)-marca | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment