C#写九九乘法表

在这里插入图片描述运行结果

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);
// }
// }

    }
}

}

发布了4 篇原创文章 · 获赞 0 · 访问量 90

猜你喜欢

转载自blog.csdn.net/lx_fighting/article/details/104081966
今日推荐