游客 Signup | Login
中文 | En

2033 - P342 12

P342 12

Input

n

Output

stars

Examples

Input

4

Output

****
*  *
*  *
****

Solution C++

#include<iostream>

using namespace std;

void Rectangle(int);

int main()
{
	int a;
	cin >> a;
	Rectangle(a);

	return 0;
}

void Rectangle(int a)
{
	for(int col=1; col<=a; col++)
	{
		cout << '*';
	}
	cout << endl;
	for(int row=2; row<=a-1; row++)
	{
		cout << '*';
		for(int col=2; col<=a-1; col++)
		{
			cout << ' ';
		}
		cout << '*' << endl;
	}
	for(int col=1; col<=a; col++)
	{
		cout<< '*';
	}
	cout << endl;
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题