> I can't get str and jump from it.
No idea what you are trying to say.
Notice that cin>>n does not extract whitespace. If you pressed "42\n" then "\n" would remain in the buffer. getline() stops at the line break, so it will see a blank line. To fix that you may use cin.ignore();