方法一:
#include<iostream>
#include<cmath>
using namespace std;
int sushu(int x)
{
int t = 0;
for (int i = 2; i <= sqrt(x); i++)
{
if (x % i == 0) t++;
if (t == 0) return 1;
else return 0;
}
}
方法二:
欸?记错了?目前只用了一种啊…后面碰到再来补上…
方法一:
#include<iostream>
#include<cmath>
using namespace std;
int sushu(int x)
{
int t = 0;
for (int i = 2; i <= sqrt(x); i++)
{
if (x % i == 0) t++;
if (t == 0) return 1;
else return 0;
}
}
方法二:
欸?记错了?目前只用了一种啊…后面碰到再来补上…