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: 566 byte
using System;
namespace Szorzat
{
class Program
{
public int[] tag = new int[100];
public Program()
{
tag[0] = 2;
}
void Bont(int n, int szint)
{
if (n == 1) {
for (int i = 1; i <= szint; i++) {
Console.Write("{0} ", tag[i]);
}
Console.WriteLine();
} else {
for (int i = tag[szint]; i <= n; i++)
if (n % i == 0) {
tag[szint + 1] = i;
Bont(n / i, szint + 1);
}
}
}
public static void Main()
{
Program program = new Program();
program.Bont(60, 0);
Console.ReadLine();
}
}
}