BlueBook - 10 Primes on a Line

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 16M

Problem type
Bluebook

A natural number N (greater than one), is a prime number if it has no natural number divisors other than 1 and N. Given an integer M, write a program that finds the first M primes, printing them ten to a line. Each number should be separated by a space.

Sample Input

5

Sample Output

2 3 5 7 11

Comments

There are no comments at the moment.