C#打印九九乘法表、、、

----------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace demo {
   public class Test {
                   public static void Main(String [] args) {
						 for (int i = 1; i < 10; i++) {
						   for (int s = 1; s <= i; s++) {
							 Console.Write(s + "*" + i + "=" + i * s + " ");
							 if (i == s) {
							   Console.Write("\n");
							 }						   }
						 }
					     Console.Write("请按任意键急促...........");
					Console.ReadKey();  }
   }
}

-----------------------------------------------

-----------------------------------------------

using System;
using System.Collections.Generic;
namespace demo
{
   public class Test
   {
                   public static void Main(String [] args)
                   {
					   Console.WriteLine("C#C#C#C#C#C#C#C#C#C#C#C#");
                            Console.WriteLine("Hello World !");
							Console.WriteLine("Hello World !");
							Console.WriteLine("Hello World !");
							Console.WriteLine("Hello World !");
							Console.WriteLine("Hello World !");
						Console.WriteLine("C#C#C#C#C#C#C#C#C#C#C#C#");
			//-------------输出乘法口诀:-------------------
			Console.WriteLine("九九乘法表——按回车键继续");//打印表头
            int i;//定义变量i
            int j;//定义变量j
            for (i = 1; i < 10; i++)
            {
                for (j = 1; j <= i; j++)
                {
                    //输入计算公式
                    Console.Write("{0}×{1}={2}\t", j, i, j * i);
                }
                Console.WriteLine();
                Console.ReadLine();
            }
			//-------------输出乘法口诀:-------------------
	   Console.WriteLine("C#C#C#C#C#C#C#C#C#C#C#C#");
                            Console.WriteLine("Hello World !");
							Console.WriteLine("Hello World !");
							Console.WriteLine("Hello World !");
							Console.WriteLine("Hello World !");
							Console.WriteLine("Hello World !");
						Console.WriteLine("C#C#C#C#C#C#C#C#C#C#C#C#");
//-------------输出乘法口诀:-------------------
			Console.WriteLine("九九乘法表——按回车键继续");//打印表头
            int x;//定义变量i
            int y;//定义变量j
            for (x = 1; x < 10; x++)
            {
                for (y = 1; y <= x; y++)
                {
                    //输入计算公式
                    Console.Write("{0}×{1}={2}\t", y, x, y * x);
                }
                Console.WriteLine();
                Console.ReadLine();
            }
			//-------------输出乘法口诀:-------------------
                   }
   }
}

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;  

namespace demo
{
   public class Test1
   {
                   public static void Main(String [] args)
                   {
                            for (int i = 1; i < 10; i++)
            {
                for (int j = 1; j <= i; j++)
                {
                    Console.Write(string.Format("{0}*{1}={2} ", j, i, i * j));
                }
                Console.WriteLine();
            }
            Console.Read();
         }
   }
}

 

-----------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;  

namespace demo
{
   public class Test2
   {
                   public static void Main(String [] args)
                   {  

						 for (int i = 1; i < 10; i++) {
						   for (int s = 1; s <= i; s++) {
							 Console.Write(s + "*" + i + "=" + i * s + " ");
							 if (i == s) {
							   Console.Write("\n");
							 }
						   }
						 }
					     Console.Write("请按任意键继续...........");
						 Console.ReadKey();

                   }
   }
}

  

-----------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;  

namespace demo
{
   public class Test3
   {
                   public static void Main(String [] args)
                   {
                            Console.WriteLine("Hello World !");
							 //倒三角
            for (int i = 9; i >= 1; i--)
            {
                for (int j = i; j >= 1; j--)
                {

                    Console.Write("{0}*{1}={2} ", i, j, i * j);  //不换行
                }
                Console.WriteLine(); //换行
            }
            Console.ReadLine();
                   }
   }
}

  

-----------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;  

namespace demo
{
   public class Test4
   {
                   public static void Main(String [] args)
                   {
                            Console.WriteLine("Hello World !");
							for (int i = 1; i <= 9; i++)
            {
                for (int j = 1; j <=i; j++)
                {
                    Console.Write(j+"×"+i+"="+i*j+"\t");
                }
                Console.WriteLine();
            }
Console.Read();
                   }
   }
}

  

-----------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;  

namespace demo
{
   public class Test6
   {
                   public static void Main(String [] args)
                   {
                            Console.WriteLine("Hello World !");
							  //one
            Console.WriteLine("        九九乘法表");
            for (int i = 1; i <= 9; i++) {
                for (int j = 1; j <= 9; j++) {
                    Console.Write("{0}*{1}={2,-2} ", i, j, i*j);
                }
                Console.WriteLine();
            }  

            //two
            Console.WriteLine("九九乘法表");
            for (int i = 1; i <= 9; i++) {
                for (int j = 1; j <= i; j++) {
                    Console.Write("{0}*{1}={2,-2} ", i, j, i * j);
                }
                Console.WriteLine();
            }  

            //three
            Console.WriteLine("九九乘法表");
            for (int i = 1; i <=9; i++) {
                    for (int k = 0; k < i - 1; k++) {
                        Console.Write("       ");
                    }
                    for (int j = i; j <= 9; j++)
                    {
                        Console.Write("{0}*{1}={2,-2} ", i, j, i * j);
                    }
                Console.WriteLine();
            }
                Console.ReadLine();
                   }
   }
}

  

-----------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;  

namespace demo
{
   public class Test7
   {
                   public static void Main(String [] args)
                   {
                            Console.WriteLine("Hello World !");
							 int sum=0; //乘积
        for(int i=1;i<10;i++) //乘数
        {
            for(int j=1;j<=i;j++) //被乘数
            {
                sum=i*j;
                Console.Write("{1}*{0}={2}\t",i,j,sum);
            }
			   Console.ReadKey();
                   }
				    }
   }
}

  

-----------------------------------------------

-----------------------------------------------

-----------------------------------------------

-----------------------------------------------

-----------------------------------------------

-----------------------------------------------

-----------------------------------------------

-----------------------------------------------------------------

C#打印九九乘法表的更多相关文章

  1. scala打印九九乘法表的5种实现

    使用scala打印九九乘法表,可以有多种实现方法,实现的过程充分的体现的scala语言的优势和巨大的简洁性和高效性, 下面我用了5种方法实现九九乘法表. 使用类似于java,c++等指令风格的的编程实 ...

  2. 利用Python循环(包括while&for)各种打印九九乘法表

    一.for循环打印九九乘法表 #注意:由于缩进在浏览器不好控制,请大家见谅,后续会有图片传入. 1.1 左下角 for i in range(1,10): for j in range(1,i+1): ...

  3. 写一个方法,用一个for循环打印九九乘法表

    public class MultiplicationTable { /**  * @description 写一个方法,用一个for循环打印九九乘法表   * @author  wangkun  * ...

  4. python脚本7_打印九九乘法表

    #打印九九乘法表 for i in range(1,10): s = "" for j in range(1,i+1): s += str(j) + '*' + str(i) + ...

  5. python—用for循环、while循环和一句话打印九九乘法表

    用for循环打印九九乘法表: for i in range (1,10): for j in range(1,10): print(j,"x",i,"=",i* ...

  6. 【Java】Java_15 打印九九乘法表

    使用For循环嵌套即可打印九九乘法表 以下是具体代码: /** * 打印九九乘法表 */ package com.oliver.test; public class TestMultiplicatio ...

  7. 使用whIle循环语句和变量打印九九乘法表

    -设置i变量declare @i int --设置j变量declare @j int --设置乘法表变量declare @chengfabiao varchar(1000)--给i,j,@chengf ...

  8. python3 打印九九乘法表

    打印九九乘法表 # !/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan for i in range(1, 10): fo ...

  9. 【shell脚本】打印九九乘法表

    打印九九乘法表 一.seq介绍 seq命令用于以指定增量从首数开始打印数字到尾数,即产生从某个数到另外一个数之间的所有整数,并且可以对整数的格式.宽度.分割符号进行控制 语法: [1] seq [选项 ...

随机推荐

  1. 使用java语言编写窗口按钮

    使用java语言编写窗口按钮 代码如下: package Day08; import java.awt.FlowLayout; import javax.swing.JButton;import ja ...

  2. java文件上传Demo

    说到文件上传我们要做到: 1.引入两个包:commons-fileupload-1.2.1.jar和commons-io-1.3.2.jar 2.将form改为上传文件模式:enctype=" ...

  3. select可选择、同时可自行输入

    HTML部分: <li class="bl-form-group"> <label>诊断医生</label> <div class=&qu ...

  4. hibernate 使用枚举字段的最佳实践

    枚举类虽然很简单,但是却往往是系统中业务逻辑最集中最复杂的地方.本文将会分享我们项目中基于hibernate的枚举类使用规范,包含数据库中枚举列数据类型.注释.枚举列与枚举类的映射等. 一.枚举类定义 ...

  5. [Tyvj 1728] 普通平衡树

    大名鼎鼎的板子题w 照例先贴题面 Describtion 您需要写一种数据结构(可参考题目标题),来维护一些数,其中需要提供以下操作:1. 插入x数2. 删除x数(若有多个相同的数,因只删除一个)3. ...

  6. 主流页面编辑器比对:TinyMCE VS FCKeditor

    开发中先用的是 FCKeditor 编辑器,感觉页面展示的东西太繁琐,所以换了 TinyMCE 编辑器. 为了方便理解,本文不采用穿插比对 先看 FCKeditor : 1.jsp :结束标签不能贴着 ...

  7. robot framework 怎么点击文本总结

    点击文本有一下几种方式 1.

  8. 如何把我的Java程序变成exe文件?

    JAVA是一种“跨平台”的语言,拥有“一次编写,处处运行”的特点,让它成为当今IT行业,必不可少的一门编程语言.每一个软件开发完成之后,应该大家都需要打包程序并发送给客户,常见的方式:java程序打成 ...

  9. 一份关于webpack2和模块打包的新手指南

    webpack已成为现代Web开发中最重要的工具之一.它是一个用于JavaScript的模块打包工具,但是它也可以转换所有的前端资源,例如HTML和CSS,甚至是图片.它可以让你更好地控制应用程序所产 ...

  10. 使用Mapper专用的MyBatis Generator插件

    使用Maven执行MBG 这里有一个完整的例子,Mybatis-Spring,下面讲解的内容出自这个例子. 使用Maven插件的一个好处是可以将Maven中的属性使用${property}形式在gen ...