Created
March 15, 2023 14:09
-
-
Save modos/29408738da5ce04cda759c171bc41cf4 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
def Josh(person, k, index): | |
if len(person) == 1: | |
print(person[0]) | |
return | |
index = ((index+k)%len(person)) | |
person.pop(index) | |
Josh(person,k,index) | |
n = int(input()) | |
k = 1 | |
index = 0 | |
person=[] | |
for i in range(1,n+1): | |
person.append(i) | |
Josh(person,k,index) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment