|
namespace PermCombDemo
{
using PIEBALD.Lib.LibExt.Combinations ;
using PIEBALD.Lib.LibExt.Permutations ;
public class PermCombDemo
{
[System.STAThreadAttribute()]
public static int
Main
(
string[] args
)
{
int result = 0 ;
try
{
for ( int i = 1 ; i <= args.Length ; i++ )
{
System.Console.WriteLine ( "Permutations ( {0} )" , i ) ;
foreach
(
System.Collections.Generic.IEnumerable<string> a
in
args.Permutations ( i )
)
{
foreach ( string c in a )
{
System.Console.Write ( " {0} " , c ) ;
}
System.Console.WriteLine() ;
}
}
for ( int i = 1 ; i <= args.Length ; i++ )
{
System.Console.WriteLine ( "Combinations ( {0} )" , i ) ;
foreach
(
System.Collections.Generic.IEnumerable<string> a
in
args.Combinations ( i )
)
{
foreach ( string c in a )
{
System.Console.Write ( " {0} " , c ) ;
}
System.Console.WriteLine() ;
}
}
}
catch ( System.Exception err )
{
while ( err != null )
{
System.Console.WriteLine ( err ) ;
err = err.InnerException ;
}
}
return ( result ) ;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.