7wa 8tle
查看原帖
7wa 8tle
1342927
binyage楼主2024/10/18 19:35
#include<bits/stdc++.h>
using namespace std;
bool isprime(long long x)
{
	if(x<=1)
	{
		return 0;
	}
	for(long long i=1;i<=sqrt(x);i++)
	{
		if(x%i==0)
		{
			return 0;
		}
	}
	return 1;
}
int main()
{
	long long x;
	cin>>x;
	if(isprime(x)||x==1)
	{
		cout<<1;
	}
	else
	{
		for(long long i=n/2;i>=1;i--)
		{
			if(n%i==0)
			{
				cout<<n/i;
				return 0;
			}
		}
	}
    return 0;
}
2024/10/18 19:35
加载中...