Created
March 20, 2012 17:31
-
-
Save heat/2138417 to your computer and use it in GitHub Desktop.
Reverse word problem solve
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import sys, re, os, string | |
f = open('problem.in') | |
cases = int(f.readline()) | |
for case in range(1, cases + 1) : | |
phrase = f.readline().split() | |
phrase.reverse() | |
print "Case #%d: %s"%(case, | |
string.join(phrase, ' ')) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment