Its a bit hard to see how you intend things to be lined up since your code seems to just prints everything on one line. Perhaps you should include some endl() somewhere? If you are in doubt where, make an example of how you would like the output to be and start figuring out on what "condition" you want a new line.
Also, if you use setw() to format your output you should note, that it sets the with for the next field being output. You can see a short description on [1].[1] http://www.cprogramming.com/tutorial/iomanip.html