Beispiel #1
0
def main():
    import InputArgs

    data = InputArgs.getStrArray("6 3 7 2 0 1 9")
    print "ORIG:", " ".join(map(str, data))
    Sort(data)
    print "SORT:", " ".join(map(str, data))
def main():
  import InputArgs
  a = InputArgs.getStrArray("to be or not to be")
  print a
  s = ResizingArrayStack()
  while a:
    item = a.pop()
    print item
    if item != "-": s.push(item)
    elif not s.isEmpty(): print s.pop(), " "
  sys.stdout.write("({}) left on stack)".format(s.size()))
  for S in s: print S
Beispiel #3
0
def main(): 
    import InputArgs
    import sys

    # read in the data
    a = InputArgs.getStrArray("a b c d e f")

    # shuffle the array
    shuffle(a)

    # print results.
    sys.stdout.write('{}\n'.format(' '.join(map(str, a))))
Beispiel #4
0
def main():
  import InputArgs
  a = InputArgs.getStrArray("S O R T E X A M P L E")
  Sort(a)
  print ' '.join(map(str,a))
def main():
    import InputArgs
    a = InputArgs.getStrArray()
    Sort(a)
    print ' '.join(a)