//
// Copyright (C) 1991 Texas Instruments Incorporated.
//
// Permission is granted to any individual or institution to use, copy, modify,
// and distribute this software, provided that this complete copyright and
// permission notice is maintained, intact, in all copies and supporting
// documentation.
//
// Texas Instruments Incorporated provides this software "as is" without
// express or implied warranty.
//

#include <cool/Stack.h>				// COOL Stack class

DECLARE Stack<int>;				// Declare stack of integers
IMPLEMENT Stack<int>;				// Implement stack of integers

int main (void) {
  Stack<int> s1(10);				// Declare stack of integers
  for (int i = 1; i <= 5; i++)			// In a small loop, push "n"
    s1.pushn (i,i);				// copies of an integer value
  for (i = 0; i < 5; i++) {			// In another similar loop upto
    for (int j = 0; j < s1.top(); j++)		// the top element value, get
      cout << s1.pop();				// a value from stack and print
    cout << "\n";				// Now output a newline and repeat
  }
  return (0);					// Exit with OK status
}
