Ejemplo n.º 1
0
def main():
    value = [0]

    while primes_read(sys.stdin, value):
        primes_print(sys.stdout, primes_eval(value[0]))
Ejemplo n.º 2
0
 def test_print2(self):
     writer = StringIO.StringIO()
     primes_print(writer, [10000000, 3, 5, 7])
     self.assert_(writer.getvalue() == '10000000 3 5 7\n')
Ejemplo n.º 3
0
 def test_print3(self):
     writer = StringIO.StringIO()
     primes_print(writer, [])
     self.assert_(writer.getvalue() == 'Impossible.\n')
Ejemplo n.º 4
0
 def test_print1(self):
     writer = StringIO.StringIO()
     primes_print(writer, [2, 3, 5, 7])
     self.assert_(writer.getvalue() == '2 3 5 7\n')
Ejemplo n.º 5
0
def main ():
	value = [0]

	while primes_read(sys.stdin, value):
		primes_print(sys.stdout, primes_eval(value[0]))
Ejemplo n.º 6
0
	def test_print3 (self):
		writer = StringIO.StringIO()
		primes_print(writer, [])
		self.assert_(writer.getvalue() == 'Impossible.\n')
Ejemplo n.º 7
0
	def test_print2 (self):
		writer = StringIO.StringIO()
		primes_print(writer, [10000000, 3, 5, 7])
		self.assert_(writer.getvalue() == '10000000 3 5 7\n')
Ejemplo n.º 8
0
	def test_print1 (self):
		writer = StringIO.StringIO()
		primes_print(writer, [2, 3, 5, 7])
		self.assert_(writer.getvalue() == '2 3 5 7\n')