Skip to main content

Posts

Showing posts with the label Project Euler

Project Euler Problem4[C#]

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ProjectEuler { class Program { staticvoid Main(string[] args) { Console.WriteLine(Problem4(600851475143UL)); } /// <summary>/// http://projecteuler.net/problem=3/// </summary>/// <param name="number"></param>/// <returns></returns>publicstaticulong Problem4(ulong number) { ulong i = 2; while (i * i < number) { while (number % i == 0) { number = number / i; } i = i + 1; } return number; } } }