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. 入职15天,Angular2 小记!

    ng 配置@ngModule({ imports: [ BrowserModule ], //导入模块 declarations: [ AppComponent ], //导入组件 providers ...

  2. crm维护踩坑记(一)

    目录 antd es6 Object.entries() Object.keys() Object.getOwnPropertyNames() 很神奇的用法!!! eslint 傻逼 其他 参考 an ...

  3. Spring和SpringMVC父子的容器之道---[上篇]

    Spring和SpringMVC作为Bean管理容器和MVC层的默认框架,已被众多WEB应用采用,而在实际开发中,由于有了强大的注解功能,很多基于XML的配置方式已经被替代,但在实际项目中,我们经常会 ...

  4. 第一篇:webservice初探

    接触webservice也有一段时间了,为了查缺补漏,把知识点系统化,准备写几篇博文梳理下webservice的知识点,这是第一篇,对webservice进行大致的介绍. 1.什么是webservic ...

  5. 如何在通过knockout数据绑定的DOM元素上添加事件

    通过knockout数据绑定的DOM元素,通过chrome控制台打断点知道,DOM元素会被暂时隐藏,使用document.querySelector()是获取不到的,会显示null,直到数据绑定完成才 ...

  6. JDBC之组件封装

    本文所需架包:mysql-connector-java-5.1.7-bin.jar(连接MySQL数据库需要),ojdbc6.jar(连接Oracle数据库需要) 1.JDBC工具类(JDBCUtil ...

  7. 完整版ajax+百度echarts实现统计图表demo并随着窗口大小改变而自适应

    1.前言 百度Echarts会常用到我们的项目中做统计,api很详细,demo也非常之多,我们常用的是应有尽有了,做一些小项目的时候,百度echarts的demo已足够用了.今天呢.主要是跟小白讲一下 ...

  8. 使用 Router 实现的模块化,如何优雅的回到主页面

    使用 Router 实现的模块化,如何优雅的回到主页面 版权声明: 本账号发布文章均来自公众号,承香墨影(cxmyDev),版权归承香墨影所有. 未经允许,不得转载. 一.前言 现在越来越多的 App ...

  9. [补档][NOI 2008]假面舞会

    [NOI 2008]假面舞会 题目 一年一度的假面舞会又开始了,栋栋也兴致勃勃的参加了今年的舞会.今年的面具都是主办方特别定制的.每个参加舞会的人都可以在入场时选择一个自己喜欢的面具. 每个面具都有一 ...

  10. 结合bootstrap fileinput插件和Bootstrap-table表格插件,实现文件上传、预览、提交的导入Excel数据操作流程

    1.bootstrap-fileinpu的简单介绍 在前面的随笔,我介绍了Bootstrap-table表格插件的具体项目应用过程,本篇随笔介绍另外一个Bootstrap FieInput插件的使用, ...