Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
solution to problem #3 from projecteuler.net
//Project Euler #3 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { long n = 600851475143; for(int i=1; i <= Math.Sqrt(n)+1; i++) if(n % i == 0 && IsPrime(i)) Console.Write(" "+i); } public static bool IsPrime(int number) { if(number == 1 || number == 2) return true; for(int i=2; i<=Math.Sqrt(number)+1; i++) if(number % i == 0) return false; return true; } } }
run
|
edit
|
history
|
help
2
cSS
4.2 Casting
Free Tiktok Fans Generator
Linked list problem with remove
Exp Regular
Programa_01_01_Declaracion_de_clases
Square Integer Matrix
mo3dal
4
c# with mysql