最简单的C#程序,新建一个控制台应用程序,然后输入代码:
using System;
using System.Collections.Generic;
using System.Text;
namespace 九九乘法表
{
class ForApp
{
static void Main( string[] args)
{
Console.WriteLine( "九九乘法表");
for ( int i = 1; i <= 9; i++)
{
for ( int j = 1; j <= i; j++)
{
Console.Write( "{0}*{1}={2}\t", i, j, i * j);
}
Console.WriteLine();
}
}
}
}
using System.Collections.Generic;
using System.Text;
namespace 九九乘法表
{
class ForApp
{
static void Main( string[] args)
{
Console.WriteLine( "九九乘法表");
for ( int i = 1; i <= 9; i++)
{
for ( int j = 1; j <= i; j++)
{
Console.Write( "{0}*{1}={2}\t", i, j, i * j);
}
Console.WriteLine();
}
}
}
}
由于是初学,可能一些命名规则不是很规范,还请读者看了后指出,谢谢。
转载于:https://blog.51cto.com/jayai/127979