You're probably best off with a 50cm frame (for a road bike) or 39cm frame (for a mountain bike). Depending on how you like the fit you could adjust around some to a slightly larger (51, 52cm) or smaller (48, 49cm) frame.
If you're buying from a bike shop, you should get the opportunity to...