提交时间:2026-01-04 15:24:33

运行 ID: 80625

if (solid == 1) { for (int i = 0; i < height; i++) { cout << string(width, ch) << endl; } } else { // 第一行 cout << string(width, ch) << endl; // 中间行 for (int i = 1; i < height - 1; i++) { cout << ch << string(width - 2, ' ') << ch << endl; } // 最后一行(如果height>1) if (height > 1) { cout << string(width, ch) << endl; } }