![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
||||
|
||||
Write list of composite numbers as sum of 2 prime numbersSo every composite number can be written as a sum of two prime numbers.
http://en.wikipedia.org/wiki/Composite_number http://en.wikipedia.org/wiki/Prime_number Task: User inputs int n, and also composite numbers which are saved in list which length is n. For every composite number of the list print the sum of two prime numbers. Solution: Python Code:
Python Code:
|
||||
|
#2
|
||||
|
||||
Re: Write list of composite numbers as sum of 2 prime numbersOh I almost forgot.
Sample Input/Output Code:
|
|
#3
|
|||
|
|||
Re: Write list of composite numbers as sum of 2 prime numbersQuote:
Python Code:
Output Code:
Regards, Dave |
|
#4
|
||||
|
||||
Re: Write list of composite numbers as sum of 2 prime numbersOh yeah.
Thanks Dave. Cheers. |
|
#5
|
||||
|
||||
Re: Write list of composite numbers as sum of 2 prime numbersBeen learning Python while I wasn't looking, eh Dave?
![]() __________________
Start Programming with Python-A beginner's guide to programming and the Python language. Interested in pen & paper role playing games from the "golden age" of gaming? Visit Old School Role-Playing Games |
Recent GIDBlog
Configuring iptables for Webmin Servers Index Module by gidnetwork
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Str_Misaligned in Double Link List | Peter_APIIT | C Programming Language | 1 | 29-Feb-2008 20:50 |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 07:44 |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 15:13 |
Network Sites: GIDNetwork · GIDApp · GIDSearch · Learning Journal by J de Silva, The