<%@page contentType="text/html; charset=GBK"%>
<html>
<head>
<title>正方形及其对角线</title>
</head>
<body bgcolor="#ffffff">
<h2 align="center">正方形及其对角线</h2>
<br/>

<h4 align="center">
<%
  int row = 7;
  int col = 7;
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < col; j++) {
      if (i == 0 || i == row - 1 || j == 0 || j == col - 1 || i == j || i == (col - 1 - j)) {
        out.print("*");
        out.print("&nbsp;&nbsp;");
      }
      else {
        out.print("&nbsp;&nbsp;&nbsp;");
      }
    }
    out.print("<br>");
  }
%>
</h4>
</body>
</html>
