Số nguyên tố tiếp theo

View as PDF

Submit solution

Points: 0.01 (partial)
Time limit: 1.0s
Memory limit: 64M
Input: stdin
Output: stdout

Author:
Problem type

HoNhatTruong đang học về số nguyên tố. Bạn ấy muốn biết sau một số nguyên dương n, thì số nguyên tố tiếp theo là bao nhiêu.

Hãy viết chương trình nhập vào số n (1 ≤ n ≤ 10^6) và in ra số nguyên tố nhỏ nhất lớn hơn n.

Input

  • Một số nguyên dương n.

Output

  • Một số nguyên duy nhất là số nguyên tố nhỏ nhất lớn hơn n.

Sample Input 1

7

Sample Output 1

11

Sample Input 2

20

Sample Output 2

23

Comments

Please read the guidelines before commenting.


There are no comments at the moment.