Preparing NOJ
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).
undefined
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
undefined
本题由旧版NOJ导入,来源:Internet