日期:2014-05-18 浏览次数:20749 次
static IEnumerable<string> Arrange(string source) { for (int i = 0; i < source.Length; i++) { if (source.Length == 1) { yield return source; } else { foreach (var x in Arrange(source.Substring(0, i) + source.Substring(i + 1))) { yield return source[i] + x; } } } }