Find the periodical pattern of the zigzag movement, it is simply:

..... /
... /
.../

then repeat itself starting from row 0.
If the number of rows is n
, It is easy to see this pattern repeat in m = 2n  2
steps. What to do with a character at s[i]
is simply depending on value i % m
:
string convert(string s, int numRows) {
string out[numRows];
stringstream ss;
if (numRows < 2)
return s;
int m = numRows * 2  2;
for (int i = 0; i != (int)s.size(); ++i) {
int r = i % m;
if (r >= numRows) {
r = (numRows  1) * 2  r;
}
out[r].push_back(s[i]);
}
for (int i = 0; i != numRows; ++i) {
ss << out[i];
}
return ss.str();
}