啊啊啊
查看原帖
啊啊啊
755165
ningtianqing楼主2024/6/8 17:42
#include<iostream>
using namespace std;
long long n,cnt;
bool isPrime(int x)
{
	if(x<2)
	{
		return false;
		cout<<x<<endl;
	}
	for(int i=2;i*i<=x;i++)
	{
		if(x%i==0);
		{
			return false;
			cout<<x<<endl;
		}
	}
	if(10>x)
	{
		return true;
	}
	else
	{
		return isPrime(x/10);
	}
}
int main() 
{
	cin>>n;
//	for(long long i=2;i<=n;i++)
//	{
	if(isPrime(n))
	{
		cout<<"true";
		return 0;
	}
//	}
//	cout<<cnt;
	cout<<"false";
	return 0;
}

need help 就0分

2024/6/8 17:42
加载中...