Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
prime_number
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Text; namespace Rextester { public class Program { static void sosu(List<int> input) { int count = input.Count; if(count == 0) { input.Add(2); } else { bool check = false; bool check_sosu = true; int i = input[count - 1] + 1; while(check == false) { check_sosu = true; for ( int j = 0; j < count ; j++) { if(i%input[j] == 0) { check_sosu = false; break; } } if(check_sosu == true) { input.Add(i); check = true; } i++; } } } public static void Main(string[] args) { List<int> some = new List<int>{}; int count = 100; for(int a = 0 ; a < count ; a++ ) { sosu(some); } for(int i = 0 ; i <some.Count ; i++ ) { Console.WriteLine(some[i]); } } } }
run
|
edit
|
history
|
help
-1
BRHOOM 111
Check if string is palindrome
test examen
ProWIN2
4341
Count occurences of Character
C# constructor in inheritance
sxsadxasxd
1234
asxsd