write stack.cpp