/* 
 * This code is from "Algorithms in C, Third Edition,"
 * by Robert Sedgewick, Addison Wesley Longman, 1998.
 */
#include <stdio.h>
#include <string.h>
#include "Item.h"
#include "STACK.h"
main(int argc, char *argv[])
  { char *a = argv[1]; int i, N = strlen(a);
    STACKinit(N);
    i=0;
    while (i<N) 
      {
        if (a[i] == ')')
          printf("%c", STACKpop()); 
        if ((a[i] == '+') || (a[i] == '*')) 
          STACKpush(a[i]);
	i++;
        while ((a[i] >= '0') && (a[i] <= '9')) 
          printf("%c", a[i++]);
	printf(" ");
      }
    printf("\n");
  }       
