程序代写代做代考 #!/usr/bin/python

#!/usr/bin/python

import sys

fd = open(‘thresholdNumber.txt’, ‘r’)
threshold = int(fd.readline().strip())
fd.close()

for line in sys.stdin:
line = line.strip()
number = int(line) # There is only one number in this case

if number > threshold:
print “Less\t%d” % number
elif number < threshold: print "More\t%d" % number else: print "Equal\t%d" % number #!/usr/bin/python import sys curr_id = None # this is the "current" key curr_vals = [] id = None # The input comes from standard input (line by line) for line in sys.stdin: line = line.strip() ln = line.split('\t') id = ln[0] if curr_id == id: curr_vals.append(ln[1]) else: if curr_id: print '%s\t%s' % (curr_id, ', '.join(curr_vals)) curr_id = id curr_vals = [] # output the last key if curr_id == id: print '%s\t%s' % (curr_id, ', '.join(curr_vals))