[ create a new paste ] login | about

Link: http://codepad.org/aNPSkfsS    [ raw code | fork ]

C++, pasted on Nov 11:
#include <iostream>
using namespace std;
int main()
{
	int h,w,d,i,j;
	char c;
	cin>>h>>w>>c>>d;
	if(d==1){
		for(i=0;i<h;i++){
			for(j=0;j<w;j++)
			cout<<c<<endl;}}
	if(d==0){
		for(i=0;i<h;i++){
		if(i==0||i==h-1){
	           for(j=0;j<w;j++)
		  cout<<c<<endl;}
		else{
			for(j=0;j<w;j++){
				if(j==0)
				  cout<<c;
				if(j==w-1)
				  cout<<c<<endl;
				else
				  cout<<" ";}}}}
		return 0;
}


Output:
No errors or program output.


Create a new paste based on this one


Comments: