#include
using namespace std;
int prime (int n)
{
int i,a;
for (i = 2; i <= n / 2; i++)
if (n%i == 0)
a = 0;
else
a = 1;
return a;
cout<<endl;
}
int main()
{
int prime(int);
int n;
cout << "输入一个整数:";
cin >> n;
if (prime(n))
cout <<n<<"为素数"<< endl;
else
cout <<n<< "不为素数" << endl;
system("pause");
return 0;
}