淘先锋技术网

首页 1 2 3 4 5 6 7

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication8
{
class Program
{
static void Main(string[] args)
{

        for (int i = 2; i <= 100; i++) {
           int flag = 0;
            for (int j =2; j <i;j++ )
            {
                if (i % j == 0) flag = 1;
           }

          if(flag==0) Console.WriteLine(Convert.ToString(i));
        }           
        Console.ReadKey();         
    }

}

}
这里写图片描述