//DeepSeek代码
#include <iostream>
using namespace std;

int main() {
    int h, w, isSolid;
    char symbol;
    cin >> h >> w >> symbol >> isSolid;
    
    for (int i = 0; i < h; ++i) {
        if (isSolid == 1 || i == 0 || i == h - 1) { // 实心或首尾行
            cout << string(w, symbol) << endl;
        }
        else { // 空心中间行
            cout << symbol;
            cout << string(w - 2, ' '); // 中间的空格
            cout << symbol << endl;
        }
    }
    return 0;
}



2 comments

  • 1

Information

ID
587
Time
1000ms
Memory
256MiB
Difficulty
3
Tags
(None)
# Submissions
264
Accepted
136
Uploaded By