85求调
查看原帖
85求调
850062
zzxzczyz楼主2024/5/25 18:37
#include<bits/stdc++.h>
using namespace std;
long long q,a[1000005];
long long fun(long long x){
	int cnt=0;
	for(int i=2;i*i<=x;i++){
		while(x%i==0){
			a[++cnt]=i;
			x/=i;
		}
	}
	if(x>1){
		a[++cnt]=x;
	}
	return cnt;
}
int main(){
	cin>>q;
	if(fun(q)>=3){
		cout<<"1"<<endl<<a[1]*a[2];
	}
	else{
		cout<<"2";
	}
	return 0;
} 
2024/5/25 18:37
加载中...