提交时间:2024-10-26 23:19:32

运行 ID: 54276

#include<bits/stdc++.h> using namespace std; int main(){ int a, b, d; char c; cin >> a >> b >> c >> d; if(d == 1){ for(int i = a; i > 0; i--){ for(int j = b; j > 0; j--){ cout << c; } cout << endl; } }else{ for(int i = b; i > 0; i--){ cout << c; } cout << endl; for(int i = a - 2; i > 0; i--){ cout << c; for(int j = b - 2; j > 0; j--){ cout << " "; } cout << c <<endl; } for(int j = b; j > 0; j--){ cout << c; } } return 0; }