Suma De Cuatro Primos
Enviado por anin • 3 de Abril de 2013 • 256 Palabras (2 Páginas) • 307 Visitas
Problem:
Prime number: Is an integer larger than 1 which is divisible by no positive integers other than
1 and itself.
Waring's prime number conjecture: states that every odd integer exceeding 3 is either a
prime number or the sum of three prime numbers.
Goldbach's conjecture: Every even integer greater than 2 can be expressed as the sum of
two primes.
Task: Find a way to express a given integer as the sum of exactly 4 primes.
Input:
Each input case consists of one integer n (1 . n . 1000) on its own line. Input is terminated by
end of file.
Output:
Each input n will generate one line of output. The output line should start with the number n :
followed by a space. If there is no solution to the problem, the rest of the line should
contain No possible. If there is a solution, the rest of the line should contain the four prime
numbers that sum up to n. There should be one blank space between each pair of prime
numbers.
SampleInput
24
12
36
7
46
SampleOutput
24: 3 11 3 7
12: 2 2 3 5
36: 3 7 13 13
7: No possible
46: 11 11 17 7
Observaciones:
1. La tarea debe ser realizada a lo mas por dos personas.
2. La fecha maxima de entrega (via correo electronico al ayudante) es el dia jueves 28
de marzo de 2013 hasta las 23:59 horas.
3. El archivo fuente debe ser grabado con sus apellidos:
Tarea1_paterno1_paterno2.cpp
4. Debe agregar comentarios indicando que cada parte del codigo.
5. Se calificara con nota minima cuando: sea plagiado, o no cumpla la hora ni fecha de
entrega, o no compile.
6. No puede utilizar cadena de caracteres ni string.
...