[分享] ASP.NET(C#)输出 99 乘法表

    protected void Page_Load(object sender, EventArgs e)
    {
        
if (!IsPostBack)
        {
            
for (int i = 1; i <= 9; i++)
            {
                
for (int j = 1; j <= i; j++)
                {
                    
int k = i * j;
                    
if (i == j)
                    {
                        Response.Write(
"&nbsp;&nbsp;&nbsp;&nbsp;" + i + " * " + j + " = " + k + "<br/>");
                    }
                    
else
                    {
                        Response.Write(
"&nbsp;&nbsp;&nbsp;&nbsp;" + i + " * " + j + " = " + k);
                    }
                }
            }
        }
    }
posted @ 2009-10-18 11:37  小吴同学  阅读(1645)  评论(2编辑  收藏  举报