运行结果
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nine1
{
class Program
{
static void Main(string[] args)
{
int i, j, k,m,n;
k = 9;
m = 0;
Console.WriteLine("\n");
Console.WriteLine("\t\t\t\t九九乘法表");
for (i = 1; i <=k; i++)
{
for (j = 1; j <= i; j++)
{
m = i * j;
Console.Write("{0}{1}={2}\t", j, i, m);
}
Console.WriteLine("\n");
}
Console.Read();
//int [,] s=new int [k,k];
//while (i < k)
// {
// i++;
// if (j <= i)
// {
// j++;
// m = i * j;
// Console.WriteLine("{0}{1}={2}", i, j, m);
// }
// }
}
}
}
本文介绍了一个使用C#编程语言实现九九乘法表的简单程序。通过双重循环结构,程序能够生成并打印从1*1到9*9的所有乘法组合,为初学者提供了一个理解循环和输出格式的示例。
280

被折叠的 条评论
为什么被折叠?



