Az alábbi letöltési lehetőségek közül választhatsz: (
segítség)
Típus: text/plain
Tartalmaz szöveget
Karakterkódolás: us-ascii
Méret: 542 byte
using System;
namespace Particio
{
class Program
{
public int[] tag = new int[100];
public Program()
{
tag[0] = 1;
}
void Bont(int n, int szint)
{
if (n == 0) {
for (int i = 1; i <= szint; i++) {
Console.Write("{0} ", tag[i]);
}
Console.WriteLine();
}
else {
for (int i = tag[szint]; i <= n; i++) {
tag[szint + 1] = i;
Bont(n - i, szint + 1);
}
}
}
public static void Main()
{
Program program = new Program();
program.Bont(7, 0);
Console.ReadLine();
}
}
}