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. 【TensorFlow入门完全指南】模型篇·逻辑斯蒂回归模型

    import库,加载mnist数据集. 设置学习率,迭代次数,batch并行计算数量,以及log显示. 这里设置了占位符,输入是batch * 784的矩阵,由于是并行计算,所以None实际上代表并行 ...

  2. fzu 2257 saya的小熊饼干

    https://vjudge.net/problem/FZU-2257 题意:略 思路: 看题解补的题.正难则反的思想求概率. 首先,由于各维数之间是独立的.所以以x为例.首先,计算可以取到(i,j) ...

  3. HDOJ2004-成绩转换

    Problem Description 输入一个百分制的成绩t,将其转换成对应的等级,具体转换规则如下:90~100为A;80~89为B;70~79为C;60~69为D;0~59为E;   Input ...

  4. Linux系统运维工程该具备哪些素质

    记得在上高中时,物理老师总是会对我们一句话:"学习是件苦差事."工作后发现,其实做运维也是件苦差事.最为一名运维工程师,深知这一行的艰辛,但和IT行业其他职务一样,那就是付出的越多 ...

  5. FFmpeg任意文件读取漏洞分析

    这次的漏洞实际上与之前曝出的一个 CVE 非常之类似,可以说是旧瓶装新酒,老树开新花. 之前漏洞的一篇分析文章: SSRF 和本地文件泄露(CVE-2016-1897/8)http://static. ...

  6. Aero问题

    有时候打开电脑会发现自己的桌面有点不一样,没有原来的好看.别着急,这是因为你的Aero没有正常启动.

  7. for’ loop initial declarations are only allowed in C99 mode

    今天做南邮编程在线的编程题,编程首先计算Fibonacci数列1,1,2,3,5,8,13,21,......的前n项(n不超过40)存入一维整型数组f中,再按%12d的格式输出每项的值,每6项换一行 ...

  8. 单页面应用(spa)引入百度地图(Cannot read property 'dc' of undefined)

    难点介绍 引入百度地图的时候,用原生的获取不到dom节点. ( var mapEle = document.getElementById(testApi): var map = new BMap.Ma ...

  9. c++STL(栈、队列)

    栈stack -先入后出FILO 栈可以理解为一个坑,先掉坑里的被压在下面,等上面的走了才能出来 头文件 <stack> 入栈 push(某东西); 栈顶元素出栈 pop(); 是否为空 ...

  10. Bear and Three Balls

    链接:http://codeforces.com/problemset/problem/653/A                                                   ...