[讨论] 去年双班的计程期中考题

楼主: bztfir (恩恩呵呵)   2010-11-27 20:43:08
Arrangement
Given an integer 1<=n<=15, list all the possible arrangements of 1,2,3,..,n
Output the arrangements with increasing order.
Input:
n1
n2
...
nt
Output:
all the possible arrangement
(Output each arrangement on a seperate line. Each number follow by a space.)
Example1
Input:
2
3
Output:
1 2
2 1
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
作者: ianlini (小林)   2009-01-27 21:59:00
是用EOF节数没错 没讲通常就是EOF 请看123篇单班助教课的上课内容
作者: felixgwu (哈哈哈之王)   2009-01-27 22:21:00
可以参考一下我之前贴出来的47题程式码,原理差不多

Links booklink

Contact Us: admin [ a t ] ucptt.com