Currently your program is waiting for an EOF character which indicates the input has ended. If you are running this and entering the input from the command line, you can manually insert an EOF by pressing Ctrl+D on *nix, or Ctrl+Z on windows. This will cause your program to break out of your getline loop.

If you would rather not do that, you need a way to break out of the getline loop, otherwise it will continue to run in that loop.

A nice idea might be detecting an empty line, so pressing enter twice ends the loop: