[分享] 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);
                    }
                }
            }
        }
    }

你可能感兴趣的:(asp.net)