Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- namespace Demo
- {
- 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