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

0 comments

No comments so far...

Information

ID
143
Time
1000ms
Memory
256MiB
Difficulty
9
Tags
# Submissions
97
Accepted
8
Uploaded By