I know (or have a very educated guess) on what the problem is, but I need to mention a few tangential points. The first is to write properly indented code. It's a very small snippet, but your code is already showing inconsistencies in indentation. It's fine for a trivially small code snippet, but please make sure in the future that your code follows a proper indentation style. It helps you because you can spot mistakes faster, and it helps us to read your code.
Also, avoid the user of one letter variable names. It's quick and convenient, but unless you have specific short term situations like an iterated indexer, in the end one letter variable names only obfuscate. Is it really that hard to type a longer name?
When trying to check if a code is faulty, try to write a fully compilable code example that uses the faulty code. Had you done so, you would have determined that by itself, the code works. So something from before is creating problems.
What causes getline to skip? Well, for one thing, getline isn't skipping. Getline returns when you hit that enter key. Remember, hitting the enter key is equivalent to entering a newline character into the stream. So if getline "skips", it's really because there's a leftover newline.
The culprit is cin >> whatever. The >> operation will leave a \n in the stream buffer (cin). So when you use getline, it first encounters a \n. Equivalent to typing the enter key right away.
See
http://www.augustcouncil.com/~tgibso....html#problems . Either use getline for all input, or ignore or get rid of the newline in the buffer.