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
Numeric to graphical output using string extension method
Games
TestApp
sum of two array elements
C:\Documents and Settings\Админ\Рабочий стол\ШЭ информатика
Compiler
NumberSeenSample
Šovljanski - beskonačna petlja bez goto-a
Aggregate Exception
solution to problem #3 from projecteuler.net