int max = (int)Math.Sqrt(150) + 1; for (int i = 1; i <= max; i++) { int j = i * i; Response.Write(i + " × " + i + " = " + j + "<br />"); } 结果: 下载本文