View Code of Problem 125

#include<iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int i,j;
	for(i=1;i<=3+n*2;i++)
	{
		if(i==1||i==n+2||i==2*n+3)
		{
			cout<<" ";
			for(j=0;j<n;j++)
			{
				cout<<"-";
			}
			cout<<" "<<endl;
		}
		else
		{
			cout<<"|";
			for(j=0;j<n;j++)
			{
				cout<<" ";
			}
			cout<<"|"<<endl;
		}
	}
	
	
	
} 

Double click to view unformatted code.


Back to problem 125