#17514: __重點


089487 (089487)

學校 : 國立臺灣師範大學附屬高級中學
編號 : 82069
來源 : [140.112.16.132]
最後登入時間 :
2025-04-29 20:27:54

他所寫的:(是由兩個質因數組合) 很重要。

因此 :

#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int n;
cin>>n;
if(n%2==0) cout<<n/2<<endl;
else
{
for(int i=3;i<sqrt(n);i+=2) if(n%i==0) {n/=i;break;}
cout<<n<<endl;
}
}