Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
54311 | zhangweiran | 画矩形 | C++ | Accepted | 1 MS | 240 KB | 665 | 2024-10-27 10:00:47 |
#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; }