/** 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 10001st prime number? */ #include "0.hpp" #define _num 10001 uu factor(uu a, uu min = 1) { uu temp = min; uu sqr = (int)sqrt((double)a); while(temp < sqr) if(a % ++temp == 0) break; if(a % temp == 0) return temp; else return 1; } int main() { uu num = 1; int count = 0; do { if(factor(++num) == 1) { //cout << num << endl; ++count; } } while(count < _num); cout << num << endl; return 0; }