标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1847 Accepted Submission(s): 629
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include <queue> using namespace std; int main(){ int n; while(scanf("%d",&n)!=EOF){ int id = 0,MAX=1; int m = n; for(int i=2;i*i<=n;i++){ if(n%i==0){ MAX = max(i,MAX); while(n%i==0) n/=i; } } MAX = max(n,MAX); if(MAX==1) printf("0\n"); else printf("%d\n",m/MAX); } return 0; }
标签:
原文地址:http://www.cnblogs.com/liyinggang/p/5661409.html