C# 100以内质数和
int sum = 0;
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)
{
sum += k;
}
}
Console.WriteLine(sum);
Console.ReadLine();