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 n = int.Parse(Console.ReadLine());
- string prime = "Not Prime";
- int duplicate = 0;
- for (int i = 2; i <= n; i++)
- {
- if (n % i == 0 && n % 1 == 0 && n > 1)
- {
- prime = "Prime";
- }
- if (n % i == 0)
- {
- duplicate++;
- }
- }
- if (duplicate > 1)
- {
- prime = "Not Prime";
- }
- Console.WriteLine(prime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement