using System;
using System.Collections.Generic;
using System.Text;
class PrimeNumber
{
public static List
{
beginNum = beginNum <= 1 ? 2 : beginNum;
int offset = beginNum;
bool[] checkNum = new bool[endNum - beginNum + 1];
for (int i = 0; i < endNum - beginNum + 1; i++)
checkNum[i] = true;
for (int i = 0; i < endNum - beginNum + 1; i++)
{
if (checkNum[i])
{
int j = i+offset;
while (j < endNum + 1)
{
j += i + offset;
if (j< endNum+ 1 && checkNum[j - offset])
checkNum[j - offset] = false;
}
}
}
List
for (int i = 0; i < endNum - beginNum + 1; i++)
if (checkNum[i])
result.Add(i + offset);
return result;
}
public static void Main()
{
List
Console.WriteLine(result.Count+":");
foreach (int i in result)
Console.Write(i + " ");
while (true)
{
}
}
}