排列组合问题(c#) 要求:随机给出4位数字如:1234,7777,1277,1777,组成各种不同的排列比如1234有24种不同的组合要求用C#语言实现 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 static void Main(string[] args) { Permutate("1234", "", 0); } static void Permutate(string str, string result, int length) { if (str.Length == length) { Console.WriteLine(result); } for (int i = 0; i < str.Length; i++) { Permutate(str.Remove(i, 1), result + str[i], length); } } 给个排列算法的东西:http://www.sudu.cn/info/html/edu/programming/20080212/275502.html 紧急问题!!! vs 2005创建asp.net程序问题 lion.web.calendar 狂晕呀!DataGrid中分页怎么就不行呢,看了N个内贴子了!!!!! 急啊,各位大哥救命!!!(TreeView中的CheckBox问题)高手救命啊!! 如何固定DataGrid表格?? sql server 2000 MVC4 DropDownList bool类型 如何根据一个网页对话框的返回值,改变WebForm上某一控件的值或属性 简单一问 关于文件路径问题 这样的效果该用什么控件?(内详)
static void Main(string[] args)
{
Permutate("1234", "", 0);
}
static void Permutate(string str, string result, int length)
{
if (str.Length == length)
{
Console.WriteLine(result);
}
for (int i = 0; i < str.Length; i++)
{
Permutate(str.Remove(i, 1), result + str[i], length);
}
}
http://www.sudu.cn/info/html/edu/programming/20080212/275502.html