[討論] 去年雙班的計程期中考題

作者: 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