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.Fast_Prime_Checker
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- for (int i = 2; i <= n; i++)
- {
- bool check = true;
- for (int g = 2; g <= Math.Sqrt(i); g++)
- {
- if (i % g == 0)
- {
- check = false;
- break;
- }
- }
- Console.WriteLine($"{i} -> {check}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment