Table of Contents
1 Problem
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143?
2 Solution
很简单没什么好说的,只是有几点需要注意。
- C++中整型文字常量太大,需要在数字后加 LL
- 找素数时,除了2,其它以2为递增寻找
3 Answer
6857
Source:C++
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143?
很简单没什么好说的,只是有几点需要注意。
6857
Source:C++