Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _15_FastPrimeChecker
- {
- class Program
- {
- static void Main(string[] args)
- {
- int N = int.Parse(Console.ReadLine());
- for (int i = 2; i <= N; i++)
- {
- bool IsPrime = true;
- for (int j = 2; j <= Math.Sqrt(i); j++)
- {
- if (i % j == 0)
- {
- IsPrime = false;
- break;
- }
- }
- Console.WriteLine($"{i} -> {IsPrime}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement