Advertisement
Have_To_Freeze

Untitled

Sep 20th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.08 KB | None | 0 0
  1. ''' 0 = 사탕 1
  2.    1 = 사탕 2
  3.    2 = 음료수 1
  4.    3 = 음료수 2
  5.    4 = 음료수 3
  6.    5 = 음료수 4 '''
  7.  
  8. rstList = []
  9.  
  10. for A1 in range(6):
  11.     for A2 in range(6):
  12.         for B1 in range(6):
  13.             for B2 in range(6):
  14.                 for C1 in range(6):
  15.                     for C2 in range(6):
  16.                         if A1 != A2 and A1 != B1 and A1 != B2 and A1 != C1 and A1 != C2 and \
  17.                            A2 != B1 and A2 != B2 and A2 != C1 and A2 != C2 and \
  18.                            B1 != B2 and B1 != C1 and B1 != C2 and \
  19.                            B2 != C1 and B2 != C2 and \
  20.                            C1 != C2:
  21.                             if (A1 + A2 != 1) and (B1 + B2 != 1) and (C1 + C2 != 1):
  22.                                 if not [sorted([A1, A2]), sorted([B1, B2]), sorted([C1, C2])] in rstList:
  23.                                     rstList.append([sorted([A1, A2]), sorted([B1, B2]), sorted([C1, C2])])
  24.  
  25. for i in range(len(rstList)):
  26.     print('A: {}, B: {}, C: {}  {}번째'.format(rstList[i][0], rstList[i][1], rstList[i][2], i + 1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement