------
## 最终结论
```python
def convert(s: str, numRows: int) -> str:
    if numRows == 1 or numRows >= len(s):
        return s

    # 创建一个列表来存储每一行的字符
    rows = [''] * numRows
    current_row = 0
    going_down = False

    # 遍历字符串
    for char in s:
        rows[current_row] += char
        # 如果到达顶部或底部，改变方向
        if current_row == 0:
            going_down = True
        elif current_row == numRows - 1:
            going_down = False
        
        current_row += 1 if going_down else -1

    # 生成结果字符串
    return ''.join(rows)
```