Use C++11 for loop instead of std::for_each

Also include using decls in function
Make print_table generic across containers
Add nth-prime