62.编制一个C#控制台应用程序,利用二重for循环语句,打印出九九乘法口诀表。

c#问题 用控制台应用程序编写

for(int i=1;i<=9;i++){
for(int j=1;j<=i;j++){
Console.Write(j+"*"+i+"="+j*i);
}
Console.Write("\n");
}
Console.ReadLine();
温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-12-24

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace for_jiujiu

{

class Program

{

static void Main(string[] args)

{

Console.WriteLine("九九乘法表: ");

int i, j, s = 0;

for(i = 1; i < 10; i++)

{

for(j = 1; j <= i; j++)

{

s = i * j;

Console.WriteLine(i +"*" + j  + "=" + s);

}

}

Console.ReadLine();

}

}

}

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网