Add project files.

This commit is contained in:
medojanos
2025-01-17 12:32:04 +01:00
parent 34fb516150
commit 44182deb1c
5 changed files with 148 additions and 0 deletions

28
primtenyezo/Program.cs Normal file
View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace primtenyezo
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Prímtényezős felbontás");
Console.Write("Pozitív egész szám: ");
int szam = Convert.ToInt32(Console.ReadLine());
int oszto = 2;
while (szam > 1) {
while (szam % oszto == 0) {
Console.WriteLine("{0}\t | \t{1}", szam, oszto);
szam = szam / oszto;
}
oszto++;
}
Console.WriteLine("{0} \t |", szam);
Console.ReadKey();
}
}
}