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;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int i = 1, szam = 0, db = 0;
- szam = int.Parse(Console.ReadLine());
- while (i <= szam)
- {
- if (szam % i == 0)
- {
- db++;
- }
- i++;
- }
- if (db == 2)
- Console.WriteLine("Prím");
- else
- Console.WriteLine("Nem prím");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement