using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _100以内的质数_一行5个
{
class Program
{
static void Main(string[] args)
{
int k=0;
for (int a = 2; a <= 100; a++)
{
if (a == 2 || a == 3 || a == 5 || a == 7)
{
Console.Write("{0}{1}", a, ++k % 5 != 0 ? " " : "\r\n");
}
else if ((a % 2 == 0 || a % 3 == 0 || a % 5 == 0 || a % 7 == 0) && (a != 2 || a != 3 || a != 5 || a != 7))
{
continue;
}
else
{
Console.Write("{0}{1}", a , ++k % 5 != 0 ? " " : "\r\n");
}
}Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _100以内的质数_一行5个
{
class Program
{
static void Main(string[] args)
{
int k=0;
for (int a = 2; a <= 100; a++)
{
if (a == 2 || a == 3 || a == 5 || a == 7)
{
Console.Write("{0}{1}", a, ++k % 5 != 0 ? " " : "\r\n");
}
else if ((a % 2 == 0 || a % 3 == 0 || a % 5 == 0 || a % 7 == 0) && (a != 2 || a != 3 || a != 5 || a != 7))
{
continue;
}
else
{
Console.Write("{0}{1}", a , ++k % 5 != 0 ? " " : "\r\n");
}
}Console.ReadKey();
}
}
}