there is a stack which is pushed with different size pancake.
the problem is how to sort this stack so that the largest pancake is on the bottom the smallest is on the top. The size of pancake is given by the integer.
for example
8
6
4
5
7
after sorting it will be
4
5
6
7
8

Note just use the template stack only

Take a look at this: It'll help you along.
http://www.daniweb.com/techtalkforums/announcement8-2.html

In other words, post code first, then we'll help.
Some tips:
Write down how you'd do this task without a computer if you could only move one pancake at a time.
You'll need:

A way to compare sizes.
A way to put pancakes on the stack.
A way to take pancakes off the stack.