maj
This commit is contained in:
parent
3f5a46ac87
commit
5a2a53b466
13
banquet.py
13
banquet.py
@ -1,6 +1,7 @@
|
|||||||
nbPersonnes = int(input())
|
nbPersonnes = int(input())
|
||||||
nbChangPosition = int(input())
|
nbChangPosition = int(input())
|
||||||
position = [0] * nbPersonnes
|
position = [0] * nbPersonnes
|
||||||
|
positionTemp = [0] * nbPersonnes
|
||||||
|
|
||||||
for loop in range(nbPersonnes):
|
for loop in range(nbPersonnes):
|
||||||
position[loop] = int(input())
|
position[loop] = int(input())
|
||||||
@ -9,9 +10,13 @@ for loop in range(nbChangPosition):
|
|||||||
pos1 = int(input())
|
pos1 = int(input())
|
||||||
pos2 = int(input())
|
pos2 = int(input())
|
||||||
|
|
||||||
personneA = position[pos1]
|
positionTemp[pos1] = position[pos2]
|
||||||
personneB = position[pos2]
|
positionTemp[pos2] = position[pos1]
|
||||||
|
|
||||||
|
position[pos1] = positionTemp[pos1]
|
||||||
|
position[pos2] = positionTemp[pos2]
|
||||||
|
|
||||||
|
print()
|
||||||
|
|
||||||
|
for loop in range(nbPersonnes):
|
||||||
|
print(position[loop])
|
Loading…
x
Reference in New Issue
Block a user