提交时间:2023-02-07 21:05:37

运行 ID: 7807

#include<iostream> using namespace std; int main(){ int height, wideth; bool issolid; char a; cin >> height >> wideth >> a >> issolid; for (int i=0; i<height; i++){ for (int j=0; j<wideth; j++){ if (i == 0 || i == height-1){ cout << a; } else { if (issolid == true){ cout << a; } else { if (j == 0 || j == wideth-1){ cout << a; } else { cout << " "; } } } } cout << endl; } return 0; }