用C#编写乘法口决

来源:百度知道 编辑:UC知道 时间:2024/06/08 14:32:04
用C#编写乘法口决

main()
{
int i,j;
for(i=1;i<=9;i++)
{
for(j=1;j<=i;j++)
{
printf("%dX%d=%d ",i,j,i*j);
}
printf("\n");
}
return 0;
}

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication16
{
class Program
{
static void Main(string[] args)
{
for (int i = 1; i <= 9; i++)
{
for (int j = 1; j <= i; j++)
{
Console.Write(j.ToString() + "*" + i.ToString() + "=" + (i * j).ToString() + " ");
}
Console.WriteLine();
}
Console.ReadKey();
}
}
}

http://zhidao