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: utf-8
Méret: 975 byte
using System;
namespace hatodik
{
class particio
{
public int[] t;
public int c = 0;
public void par(int n,int m)
{
if (n == 0)
{
for (int z = 1;z <= m;z++)
{
Console.Write("{0} ",t[z]);
}
Console.WriteLine();
c++;
} else
{
for (int i = t[m];i <= n;i++)
{
t[m+1] = i;
par(n - i,m + 1);
}
}
}
public static void Main()
{
particio p = new particio();
int d = Int32.Parse(Console.ReadLine());
p.t = new int[d+1];
p.t[0] = 1;
p.par(d,0);
Console.WriteLine(p.c);
Console.ReadKey(true);
}
}
}