#include <iostream>
usingnamespace std;
int main()
{
int x = 5;
int r=0,c;
while ( r < x)
{
c=0;
while( c < x)
{
if ( c == 0 || c == x - 1 || r == 0 || r == x - 1)
cout << "*";
else
cout << " ";
c++;
} // inner while
cout << endl;
r++;
} // outer for
}