Created
November 7, 2014 21:46
-
-
Save kiloreux/f6a15b4eeb00a5b854b0 to your computer and use it in GitHub Desktop.
My solution to Project Euler problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
bool isPrime(long long kil) | |
{ | |
for (long long i=2;i<kil;i++) | |
{ | |
if(kil%i==0) | |
{ | |
return false; | |
} | |
} | |
return true; | |
} | |
using namespace std; | |
int main(void) | |
{ | |
long long i=2,primeNumber=0; | |
while(true) | |
{ | |
if(isPrime(i)) | |
{ | |
primeNumber++; | |
} | |
if(primeNumber==10001) | |
{ | |
break; | |
} | |
i++; | |
} | |
cout<<i<<endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment