/*
* Copyright (c) 2012, 烟台大学计算机学院
* All rights reserved.
* 作者:耿娜
* 完成日期:2012 年11月15日
* 版本号:v1.0
*
* 输入描述:无
* 问题描述:判断一个数是否为素数
* 程序输出:数据类型
*/
#include <iostream>
using namespace std;
int main()
{
int a,m;
bool prime=true;
cout<<"输入一正整数:"<<endl;
cin>>a;
for(m=2;m<a;m++){
if(a%m==0){
prime=false;
break;
}
}
if(prime)
cout<<a<<"是素数"<<endl;
else
cout<<a<<"不是素数"<<endl;
return 0;
}