提交时间:2023-02-01 14:54:22

运行 ID: 7180

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