Twin primes are pairs of primes of the form (p; p + 2). The term \twin prime" was coined by Paul
Stckel (1892-1919). The rst few twin primes are (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43).
In this problem you are asked to nd out the S-th twin prime pair where S is an integer that will be
given in the input.
- Input
- The input will contain Less than 10001 lines of input. Each line contains an integers S (1 S 100000),
which is the serial number of a twin prime pair. Input le is terminated by end of le.
- Output
- For each line of input you will have to produce one line of output which contains the S-th twin prime
- pair. The pair is printed in the form (p1,<space>p2). Here <space> means the space character (ASCII
32) . You can safely assume that the primes in the 100000-th twin prime pair are Less than 20000000.
- Sample Input
- 1
- 2
- 3
- 4
- Sample Output
- (3, 5)
- (5, 7)
- (11, 13)
- (17, 19)Twin primes are pairs of primes of the form (p; p + 2). The term \twin prime" was coined by Paul
Stckel (1892-1919). The rst few twin primes are (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43).
In this problem you are asked to nd out the S-th twin prime pair where S is an integer that will be
given in the input.
- Input
- The input will contain Less than 10001 lines of input. Each line contains an integers S (1 S 100000),
which is the serial number of a twin prime pair. Input le is terminated by end of le.
- Output
- For each line of input you will have to produce one line of output which contains the S-th twin prime
- pair. The pair is printed in the form (p1,<space>p2). Here <space> means the space character (ASCII
32) . You can safely assume that the primes in the 100000-th twin prime pair are Less than 20000000.
- Sample Input
- 1
- 2
- 3
- 4
- Sample Output
- (3, 5)
- (5, 7)
- (11, 13)
- (17, 19)
来源: https://www.cnblogs.com/cautx/p/11427669.html