using System;
namespace _001_003_012_continue
{
class Program
{
static void Main(string[] args)
{
int x = 1;
int qtd = 0;
while (x <= 1000)
{
if (!TestarPrimo(++x))
continue;
Console.Write("{0}\t",x);
qtd++;
}
Console.WriteLine("\n\nQuantidade de primos: {0}", qtd);
Console.ReadKey();
}
private static bool TestarPrimo(int x)
{
bool retorno = true;
for (int i = 2; i < x + 1 / 2; i++)
{
if (x % i == 0)
{
retorno = false;
break;
}
}
return retorno;
}
}
}