#!/usr/bin/python from sys import * from string import * def message(): print "Usage: multiply \n" exit() try: argument=float(argv[1]) except: message() if argument<=0: message() def parse(line): global argument try: words=line.split() number=int(words[0]) new_number=int(round(number*argument)) stdout.write((str(new_number))+' '+join(words[1:])+'\n') except ValueError: stdout.write(join(words)+'\n') except IndexError: stdout.write(line) chunk=stdin.readlines() try: for line in chunk: parse(line) except: exit()