Create 4.cc

The knowledge used in this program is from the Chapter 4, so I really don't know why would this problem be presented here.