using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int n , i ,y=1, j;
Console.Write("请您输入要查找的范围:");
n = Convert.ToInt32(Console.ReadLine()); Console.Write("2 ");
i = n;
for (int p=3;p<=n;p+=1)
{ double aa = Math.Pow(p, 0.5);
bool a=true ;
for (j = 2; j <=(int)aa ; j+=1)
{
if ((p % j == 0))
{ a = false; break; }
else if (p % j != 0)
{
a = true;
continue;
}
}
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载