展开全部
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace _99Mul
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("九九乘法表:");
for (int i = 1; i <= 9; i++)//i是行数
{
for (int j = 1; j <= i; j++)//列数j
{
Console.Write("{0}*{1}={2} ",i,j,i*j);
}
Console.WriteLine();
}
Console.ReadLine();
}
}
}
控制台可以直接输出,我编的http://hi.baidu.com/%E6%AD%A5%E5%BF%B5%E5%B0%98/ihome/myblog
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace _99Mul
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("九九乘法表:");
for (int i = 1; i <= 9; i++)//i是行数
{
for (int j = 1; j <= i; j++)//列数j
{
Console.Write("{0}*{1}={2} ",i,j,i*j);
}
Console.WriteLine();
}
Console.ReadLine();
}
}
}
控制台可以直接输出,我编的http://hi.baidu.com/%E6%AD%A5%E5%BF%B5%E5%B0%98/ihome/myblog
展开全部
一个两重循环,你随便建一个工程,默认的窗体是Form1,在窗体的Paint事件里,写这样的代码
private void Form1_Paint(object sender, PaintEventArgs e)
{
for (int i = 9; i >= 1; i--)
{
for (int j = i; j >= 1; j--)
{
e.Graphics.DrawString(j.ToString() + "*" + i.ToString() + "=" + (i * j).ToString(), new Font("宋体", 12), new SolidBrush(Color.Black), new PointF(j * 100, i * 30));
}
}
}
运行后的效果就是九九乘法表
private void Form1_Paint(object sender, PaintEventArgs e)
{
for (int i = 9; i >= 1; i--)
{
for (int j = i; j >= 1; j--)
{
e.Graphics.DrawString(j.ToString() + "*" + i.ToString() + "=" + (i * j).ToString(), new Font("宋体", 12), new SolidBrush(Color.Black), new PointF(j * 100, i * 30));
}
}
}
运行后的效果就是九九乘法表
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
using System;
class Test
{
static void Main()
{
int i,j;
for(i = 1; i <= 9; i++)
{
for(j = 1; j <=i; j++)
{
Console.Write("{0}*{1}={2,2} ",i, j , i * j);
}
Console.WriteLine();
}
}
}
class Test
{
static void Main()
{
int i,j;
for(i = 1; i <= 9; i++)
{
for(j = 1; j <=i; j++)
{
Console.Write("{0}*{1}={2,2} ",i, j , i * j);
}
Console.WriteLine();
}
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
foreach实现乘法表:
string chengfabiao = "";
int[] a = new int[10];
int[] b = new int[10];
for (int i = 0; i <= 9; i++)
{
a[i] = i;
b[i] = i;
}
foreach (int j in a)
{
foreach (int k in b)
{
if (j > 0 && k > 0 && j >= k)
{
chengfabiao += j.ToString() + "*" + k.ToString() + "=" + (j * k).ToString() + " ";
}
}
chengfabiao += "<br/>";
}
for实现乘法表:
string chengfabiao = "";
for (int i = 1; i < 10; i++)
{
for (int j = i; j < 10; j++)
{
chengfabiao += i + "*" + j + "=" + (i * j) + " ";
}
chengfabiao += "<br/>";
}
string chengfabiao = "";
int[] a = new int[10];
int[] b = new int[10];
for (int i = 0; i <= 9; i++)
{
a[i] = i;
b[i] = i;
}
foreach (int j in a)
{
foreach (int k in b)
{
if (j > 0 && k > 0 && j >= k)
{
chengfabiao += j.ToString() + "*" + k.ToString() + "=" + (j * k).ToString() + " ";
}
}
chengfabiao += "<br/>";
}
for实现乘法表:
string chengfabiao = "";
for (int i = 1; i < 10; i++)
{
for (int j = i; j < 10; j++)
{
chengfabiao += i + "*" + j + "=" + (i * j) + " ";
}
chengfabiao += "<br/>";
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
for (int i = 1; i <= 9; i++)//九行
{
for (int j = 1; j <= i; j++)//列
{
Console.Write("{0}*{1}={2} ",i,j,i*j);
}
Console.WriteLine(" ");
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
for (int i = 1; i <= 9; i++)//九行
{
for (int j = 1; j <= i; j++)//列
{
Console.Write("{0}*{1}={2} ",i,j,i*j);
}
Console.WriteLine(" ");
}
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询