PEX5

Write a C++ program PEX5.cpp that reads a sequence of 20 integers, pushing all of
the even integers onto one stack and all the odd integers onto the other. Output the
contents of each stack by popping elements until its empty. Remember to use the STL
.
THIS IS THE OUTPUT:
Run:
Enter 20 integers:
5 13 25 16 2 4 5 17 457 88 1 9 26 55 100
75 36 8 10 35
Even integers in reverse order:
10 8 36 100 26 88 4 2 16
Odd integers in reverse order:
35 75 55 9 1 457 17 5 25 13 5

×
New Download