Preparing NOJ

Primes

1000ms 65536K

Description:

Wikipedia says: A twin prime is a prime number that differs from another prime number by two. Except for

the pair (2, 3), this is the smallest possible difference between two primes. Some examples of twin prime

pairs are (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43),…

Write a program that generates the first 15 pairs of twin primes, beginning with (3,5). Display the pairs in

reverse order, so the last pair to be displayed will be (3,5).


Input:

undefined

Output:

Display each pair of values on a separate line, surrounded by parentheses and separated by a comma.

Examples are:

(17,19)

(11,13)

1386 H_PRC3


Note:

undefined

本题由旧版NOJ导入,来源:Internet

Info

NOJ

Provider NOJ

Code NOJ1386

Tags

Submitted 6

Passed 2

AC Rate 33.33%

Date 04/20/2019 10:03:10

Related

Nothing Yet