你可以看看
http://community.csdn.net/Expert/topic/3502/3502682.xml?temp=.62698
http://community.csdn.net/Expert/topic/3502/3502682.xml?temp=.62698
解决方案 »
- 如何写这个正则表达式
- 【C#算法、答题有奖,路过的进来看一看了,】
- 请教:label的值没有更新是什么原因啊
- 请问下谁知道怎么样可以实现象openfiledialog那样设置保存文件的路径?
- 大家有没有关于如何设置dns服务器弹出窗口的资料啊
- WinForm界面的问题
- 请问如何才能使一个Window窗体始终处于最前端?
- c# winform DataGridViewTextBoxColumn
- 求救~ie等浏览器都能打开网页,但是webbrower打开网页时提示不支持此对象或属性 [.NET技术 C#]
- 如何在web窗体实现框架页面?
- 各位帮我看看这个错误....
- 智能客户端的部署与更新问题,请高高手指教,在线等待。。。
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
struct word
{
public char chWord;
public int index;
};
static word[] g_wordOut; /// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
word[] Test; int nLen=0;
System.Console.WriteLine("请输入要进行排列的元素的个数"); nLen = int.Parse(System.Console.ReadLine());
System.Console.WriteLine("请输入 {0} 个元素", nLen);
// 动态分配内存
Test=new word[nLen];
for(int i=0;i<nLen;i++)
{
Test[i].chWord = (char)System.Console.Read();
Test[i].index=-1;
}
g_wordOut=new word[nLen];
for( int i=0;i<nLen;i++)
{
Test[i].index=-1;
}
System.Console.WriteLine("排列组合如下:");
format(Test,0,nLen);
}
static void format(word[] test,int dex,int Len)
{
word[] pWord=test;
for(int i=0;i<Len;i++)
{
if(pWord[i].index!=-1)
continue;
g_wordOut[dex].chWord=pWord[i].chWord;
pWord[i].index=1;
if(dex==Len-1)
{
for(int x=0;x<Len-1;x++)
{
System.Console.Write(g_wordOut[x].chWord);
}
System.Console.WriteLine(g_wordOut[Len-1].chWord);
}
format(pWord,dex+1,Len);
pWord[i].index=-1;
}
}
}
}