Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
#include &ltiostream>
#include "stack.h"
using namespace std ;
void main()
{
	typedefStack Stack&ltfloat><float> FloatStack ;
	typedefStack Stack&ltint><int> IntStack ;

	FloatStack fs(5) ;
	float f = 1.1 ;
	cout << "Pushinglaitetaan elementsluku ontoreaalilukupinoon fs" << endl ;
	while (fs.push(f))
	{
		cout << f << ' ' ;
		f += 1.1 ;
	}
	cout << endl << "StackPino Fulltäynnä." << endl
	<< endl << "PoppingOtetaan elementselementi from fspinosta" << endl ;
	while (fs.pop(f))
		cout << f << ' ' ;
	cout << endl << "Stackpino Emptytyhjä" << endl ;
	cout << endl ;

	IntStack is ;
	int i = 1.1 ;
	cout << "Pushinglaitetaan elementsluku onto iskokonaislukupinoon" << endl ;
	while (is.push(i))
	{
		cout << i << ' ' ;
		i += 1 ;
	}
	cout << endl << "Stackpino Fulltäynnä" << endl
	<< endl << "Poppingotetaan elementselementti from ispinosta" << endl ;
	while (is.pop(i))
			cout << i << ' ' ;
	cout << endl << "Stackpino Emptytyhjä" << endl ;
}