Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
40217 | 奚晨瑞 | 画矩形 | C++ | Accepted | 0 MS | 244 KB | 405 | 2024-02-08 14:04:45 |
#include<iostream> using namespace std; int main() { int a,b,d; char c; cin>>a>>b>>c>>d; if(d==1){ for(int i=0;i<a;i++){ for(int j=0;j<b;j++){ cout<<c; } cout<<endl; } } else{ for(int i=0;i<a;i++){ for(int j=0;j<b;j++){ if(i==0||i==a-1||j==0||j==b-1){ cout<<c; } else{ cout<<" "; } } cout<<endl; } } return 0; }