显示相同数字相乘的结果,直到数值大于150为止

老师布置Insus.NET做的第二道题,题目如标题。

感兴趣的网友也可以练习练习。现在Insus.NET的作答如下,但老师还没有看,因此答案是否正确或是最好的,还不能确定,只是供参考。

 int max = (int)Math.Sqrt(150) + 1;

        for (int i = 1; i <= max; i++)
        {
            int j = i * i;
            Response.Write(i + " × " + i + " = " + j + "<br />");
        }

 结果:

原文地址:https://www.cnblogs.com/insus/p/2476447.html