作业比赛编号 : 2439 - 函数练习(只能用函数方式来写)
函数专项练习,只能用函数的方式解题。
判断素数:
void isPream(int n){
bool flog=true;
for(int i=2;i<n;i++){
if(n%i==0){
flog=false;
break;
}
}
if(flog){
cout<<"是素数";
}else{
cout<<"不是素数";
}
}
