- 画矩形
DeepSeek也TAI好用了叭
- @ 2025-3-2 13:04:36
//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
-
经开一中2026届11班关泽瑞 LV 6 @ 2025-3-11 19:50:38
-
@ 2025-3-7 17:28:08
题目复杂点就老实了
- 1
Information
- ID
- 587
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- (None)
- # Submissions
- 264
- Accepted
- 136
- Uploaded By
不用这样