求助啊!!!!怎样使用VS用类来实现九九表啊???

来源:百度知道 编辑:UC知道 时间:2024/06/01 23:56:14
实现九九表以后好要能用它算数

protected void Page_Load(object sender, EventArgs e)
{
int i,j,s,L2;
string L1;
for (i=1;i<=9;i++)
{
for (j=1;j<=i;j++)
{
s=i*j;
L1 = s.ToString();
L2 = L1.Length;
if (L2==1)
{ Response.Write(j + "x" + i + "=" + s + "  "); }
else
{ Response.Write(j + "x" + i + "=" + s + " ");}

}
Response.Write("<br>");
}
}

呵呵,九九表表示任意两个个位数相乘吧

那么,一个方法,两个参数
int NineNine(int a,int b)
{

return a*b;
}