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;
- class Program
- {
- static void Main()
- {
- int e = int.Parse(Console.ReadLine());
- int number = int.Parse(Console.ReadLine());
- var primes = "";
- {
- for (int i = e; i <= number; i++)
- {
- if (i == 0 || i == 1)
- {
- i = 2;
- }
- bool isPrime = true;
- for (int j = 2; j <= Math.Sqrt(i); j++)
- {
- if (i % j == 0)
- {
- isPrime = false;
- break;
- }
- }
- if (isPrime)
- {
- primes = primes + i+ ", ";
- }
- }
- }
- primes = primes.Substring(0, primes.Length - 2);
- Console.WriteLine(primes);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement