C# 100以内质数
for (int k = 1; k <= 100; k++)
{
int count = 0;
for (int i = 1; i <= k; i++)
{
if (k % i == 0)
{
count++;
}
}
if (count == 2)
{
Console.WriteLine(k);
}
}