算法笔记.试除法判断质数

代码实现:

#include 
using namespace std;
void check(long x)
{
    if(x == 1) //注意1要特判
    {
        cout <<"No"<>n;
    while(n--)
    {
        int x;
        scanf("%d",&x);
        check(x);
    }
    return 0;
}

注意:

避免溢出的处理  i <=  x/i。

你可能感兴趣的:(算法,笔记,c++)