Here is the code:
string str; cin>>str; cout<<\"first input:\"<
Good writeup that explains some of the reasons why you are running into this issue, primarily due to the behavior of the input types and that you are mixing them