Don't have usingnamespace std;, it can cause name clashes. Refer to things in std by prefixing them with std::, like JLBorges has done with std::string. Also std::cout , std::cin , std::endl, std::vector etc.
Also compile with these switches as a suggested minimum:
this will give warnings that you may not have otherwise had. It is worth reading through the documentation for gcc, although it is long (there are zillions of options).
Can we ask you to always use code tags? Edit your post, select the code, then press the <> button on the format menu.
Hope you all are enjoying the festive season o<:+D