Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
prime_number
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//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]); } } } }
1 1 2 Q
Show compiler warnings
[
-
]
Show input
Compilation time: 0,16 sec, absolute running time: 0,09 sec, cpu time: 0,08 sec, average memory usage: 18 Mb, average nr of threads: 4
fork mode
|
history
|
discussion