eBash

It is not the mountain we conquer but ourselves

Project Euler Problem 3

| Comments

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

很简单没什么好说的,只是有几点需要注意。

  1. C++中整型文字常量太大,需要在数字后加 LL
  2. 找素数时,除了2,其它以2为递增寻找

3 Answer

6857

Source:C++

Comments