Dzień dobry!
Napisałem taki kod z zadania liczby pierwsze. Cały czas mam błędna odpowiedź. Gdzie robię błąd?
using System;
namespace Liczbypierwsze
{
class Program
{
static bool checker(int x)
{
if (x <= 2) return false;
for (int n = 2; n <= x / 2; n++)
{
if (x % n == 0)
{
return false;
}
}
return true;
}
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
int a;
for (int i = 1; i <= n; i++)
{
a = int.Parse(Console.ReadLine());
if (checker(a)) Console.WriteLine("TAK");
else Console.WriteLine("NIE");
}
}
}
}