【問題E04】:樂透彩對碰。       [回前頁]

把會出的排分成兩組,每組各取三個,進行排列組合。例如:

第一組:4,12,31,39   (注意:每組至少三個) 

第二組:16,17,26,27

對碰的結果:

共有16種組合

4,12,31,16,17,26

4,12,31,16,17,27

4,12,31,17,26,27

4,12,39,16,17,26

4,12,39,16,17,27

4,12,39,17,26,27

12,31,39,16,17,26

12,31,39,16,17,27

12,31,39,17,26,27

.................

.................

輸入格式:

請輸入下列二組號碼:

第一組:4,12,31,39

第二組:16,17,26,27

 

輸出格式:

共有16種組合

4,12,31,16,17,26

4,12,31,16,17,27

4,12,31,17,26,27

4,12,39,16,17,26

4,12,39,16,17,27

4,12,39,17,26,27

12,31,39,16,17,26

12,31,39,16,17,27

12,31,39,17,26,27

.................

.................