Пример #1
0
 static public void WritePermutationWithOrder(int order, int length)
 {
     using (StreamWriter writer = new StreamWriter("log.txt", true))
     {
         WriteDate(writer);
         WriteLine(writer, "Generating permutations for order: " + order + " and length: " + length);
         WriteLine(writer);
         int[][] permutations = WithoutRepetition.AllPermutationsOfGivenOrder(order, length);
         int     counter      = 1;
         foreach (int[] permutation in permutations)
         {
             Write(writer, counter + ") ");
             counter++;
             WriteVector(writer, permutation);
             WriteLine(writer);
         }
         WriteLine(writer);
     }
 }