I try to resolve the following problem:
________________________
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?
__________________
To solve this problem I did the following code, but after I compile and run
only appear the black window without nothing in it.
Did you get an answer? Your algorithm is inefficient. If you didn't get an answer, try changing the limit from 10001 to 100 then 500 then 1000 then 5000. I think you'll find that it takes longer and longer and loooooonnnnnngggggggeeeeerrrrr.... :)
Is this for an on-line coding challenge like Euler or on-line judge ?
If so, these problems are not solved by brute force - one has to come up with a cunning plan instead.
Google and wiki are your best friends. At the bottom of the wiki page there is Euler's algorithm - which is a specialisation of sieves of Eratosthenes.