Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 03 / DevidersCount_PrimalityCheck.cpp
blob: 758472255b14e3a8bbdf88c21852184033ec61dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>

using namespace std;

int main()
{
	unsigned int n; //allways positive int
	cin >> n;

	int divCount = 0;

	for (int i = 1; i <= n; i++)
	{
		if (n%i == 0)
			divCount++;
	}
	cout << divCount;
	if (divCount == 2)
	{
		cout << "Prime";
	}
	else
	{
		cout << "Not a prime";
	}

	

}