-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
34 lines (31 loc) · 919 Bytes
/
Program.cs
File metadata and controls
34 lines (31 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//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;
namespace Rextester
{
public class Program
{
public static void Main(string[] args)
{
int count = 0;
int num = 2;
while(true){
if(isPrime(num)) count++;
if(count == 10001) break;
num++;
}
Console.WriteLine(num);
//Your code goes here
Console.WriteLine("Hello, world!");
}
static bool isPrime(int num){
for (int i = 2; i < num; i++){
if(num % i == 0) return false;
}
return true;
}
}
}