Skip to content

Instantly share code, notes, and snippets.

@qzchenwl
Created August 10, 2011 11:57
Show Gist options
  • Save qzchenwl/1136647 to your computer and use it in GitHub Desktop.
Save qzchenwl/1136647 to your computer and use it in GitHub Desktop.
最大质因子
getD n = getD' n 2 where
getD' n factor | n == factor = factor
| n `mod` factor == 0 = getD' (n `div` factor) factor
| otherwise = getD' n (succ factor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment