Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
54276 | 张思存 | 画矩形 | C++ | Accepted | 1 MS | 248 KB | 663 | 2024-10-26 23:19:32 |
#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; }