#C2694. Circle of Friends Permutations
Circle of Friends Permutations
Circle of Friends Permutations
You are given a fixed list of three friends: Alice, Bob, and Charlie. Your task is to generate all possible arrangements (permutations) of these three friends in a circular order. The output must exactly contain the following six lines:
- Alice, Bob, Charlie
- Alice, Charlie, Bob
- Bob, Alice, Charlie
- Bob, Charlie, Alice
- Charlie, Alice, Bob
- Charlie, Bob, Alice
No additional text or formatting should be output. Although the program does not require any effective input, your solution must read from stdin
(even if the input is not used) and write the result to stdout
. The expected order of outputs is as shown above.
For reference, the mathematical number of permutations is given by \(3! = 6\).
inputFormat
The program reads a single line from standard input. The input is not used in the computation and can be any non-empty string.
outputFormat
Output exactly 6 lines to standard output. Each line must contain one permutation in the following exact format: Name1, Name2, Name3
. The order of the output lines must be:
- Alice, Bob, Charlie
- Alice, Charlie, Bob
- Bob, Alice, Charlie
- Bob, Charlie, Alice
- Charlie, Alice, Bob
- Charlie, Bob, Alice
start
Alice, Bob, Charlie
Alice, Charlie, Bob
Bob, Alice, Charlie
Bob, Charlie, Alice
Charlie, Alice, Bob
Charlie, Bob, Alice
</p>