110,534
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lesson_10_homework九九乘法表
{
class Program
{
static void Main(string[] args)
{
int a1;
int b2;
for(int a = 1; a <= 9; a++)
{
a1 = a * 1;//在输出的时候好输出答案
Console.WriteLine("1*{0}={1}",a,a1);//将计算过的变量用字符串输出成算式
for (int b = 1; b <= a;b++)
{
b2 = b * a1;
Console.Write("{0}*{1}={2}\t",b,a1,b2);
}
}
Console.ReadKey();
}
}
}
还有截图/*
打印 99 表
*/
for (int i = 1; i <=9; i++)
{
for (int j = 1; j <=i; j++)
{
Console.Write($"{j}*{i}={i * j} ");
}
Console.WriteLine();
}