Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Gaussian Prime Factors
Description Let
A complex number The following are Gaussian primes: 1 + The Gaussian prime factors of 5 are: 1 + 2 Write a program that finds all the Gaussian prime factors of a positive integer. Input One line of input per case. The line represents a positive integer Output One line of output per test case. The line represents the Gaussian prime factors of n. If a + bj is a Gaussian prime factor of n, then a > 0, |b| ≥ a, if b ≠ 0. If b = 0, the output must be a.
Sample Input 2 5 6 700 Sample Output Case #1: 1+j, 1-j Case #2: 1+2j, 1-2j Case #3: 1+j, 1-j, 3 Case #4: 1+j, 1-j, 1+2j, 1-2j, 7 Hint Output the Gaussian prime factors in ascending order of Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator