#include <iostream>
using namespace std;
int main()
{
int num;
bool prime;
cin >> num;
for (int i=2;i <=num-1;i++)
{
num%i;
if(num%i==0)
{
cout << "not prime";
break;
}
else if(num%i==1)
{
cout << "prime";
break;
}
}
cin.get();
return 0;
}
Thursday, 24 January 2013
check of prime
08:16
ATEEK
No comments
0 comments:
Post a Comment