应该怎样解决呢?
public class Zhengfangxing {
public static void main(String[] args)
{ int n=5;
System.out.print("请输入边长");
try
{
n=System.in.read()-'0';
}
catch(Exception e)
{
}
for(int i=1;i<=n;i++)
{
System.out.print('*');
}
System.out.println();
for(int j=1;j<=n-2;j++)
{
System.out.print('*');
for(int k=1;k<=n-2;k++)
{
System.out.print(" ");
}
System.out.print('*');
System.out.println();
}
for(int l=1;l<=n;l++)
{
System.out.print('*');
}
}
}