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