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; }