标签:mat prim i++ scan return style div can ++
#include<stdio.h> #include<string.h> #include<math.h> int maxPrimeFactor(int n) { int i,ans=0; for(i=2;i*i<=n;i++) { while(n%i==0) { ans=i; n/=i; } } if(n>1)ans=n; return ans; } int main() { int n; scanf("%d",&n); printf("%d\n",maxPrimeFactor(n)); return 0; }
标签:mat prim i++ scan return style div can ++
原文地址:https://www.cnblogs.com/DWVictor/p/10238022.html