using System;
namespace _99乘法表
{
class Program
{
static void Main(string[] args)
{
ChenFaBiao();
}
//C#九九乘法表的算法实现
public static void ChenFaBiao()
{
string t = string.Empty;
for (int i = 1; i < 10; i++)
{
for (int j = 1; j <= i; j++)
{
t = string.Format("{0}×{1}={2} ", j, i, (j * i));
Console.Write(t);
if (j * i < 10)
Console.Write(" ");
if (i == j)
Console.Write("\n");
}
}
}
}
}
|