Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
project euler 10, C#
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { double sum = 2; for(int i=3; i<2000000; i+=2) if(IsPrime(i)) sum +=i; Console.WriteLine(sum); } public static bool IsPrime(int number) { for(int i=2; i<=(int)Math.Sqrt((double)number); i++) { if(number % i == 0) return false; } return true; } } }
run
|
edit
|
history
|
help
0
Passing Multidimensional Arrays As Arguments
derfgtredwcdf
Lambda Expressions Are Cool
count number of words in string
Rextester
ConcurrentDictionary<T>
Test LINQ Anagrafica
fnaf
FizzBuzz Solution
Octavia