Skip to content

Latest commit

 

History

History
 
 

009-stack-implementation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Stack Implementation

Challenge Description:

Write a program which implements a stack interface for integers. The interface should have ‘push’ and ‘pop’ functions. Your task is to ‘push’ a series of integers and then ‘pop’ and print every alternate integer.

Input sample:

Your program should accept a file as its first argument. The file contains a series of space delimited integers, one per line.

For example:

1 2 3 4
10 -2 3 4

Output sample:

Print to stdout every alternate space delimited integer, one per line.

For example:

4 2
4 -2