编写程序,输出九九乘法表 谁知道啊速度,急用!!!

来源:百度知道 编辑:UC知道 时间:2024/05/24 19:04:02
用C#编程

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

namespace multiplication
{
class Program
{
static void Main(string[] args)
{
for (int i = 1; i < 10; i++)
{
for (int j = 1; j <= i; j++)
{
string s="";
int m = i * j;
if (m < 10)//我这个人爱面子,这样写界面比较好,其他的没啥用处。
{
s = m.ToString() + " ";
Console.Write(i + "*" + j + "=" + s + " ");
}
else
{
s = m.ToString();
Console.Write(i + "*" + j + "=" + s + " ");
}

}