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. IScroll那些事——内容不足时下拉刷新

    之前项目中的列表是采用的IScroll,但是在使用IScroll有一个问题就是:当内容不足全屏的时候,是木有办法往下拉的,这样就达不到刷新的目的了.[这是本人工作中遇到的,具体例子具体分析,这里只作一 ...

  2. git bash上传代码到github

    今天,老爷机notebook开始卡了,我决定格盘重装系统. 顺便复习一下git本地命令的使用 1,配置 2先跳过一般的操作.介绍链接github远程库的操作 我的两个钥匙在C:\Users\bond\ ...

  3. TCP服务通讯

    一.TCP 1.TCP又叫做套接字,传输安全,速度慢. TCP和UTP是网络的传输协议,跟java没什么关系,没有说用java做的客户端必须连接java做的服务器,我们可以用c和c++做客户端,直接连 ...

  4. FreeRTOS——中断管理

    1. 只有以“FromISR”或"FROM_ISR"结束的API函数或宏才可以在中断服务函数中使用. 2. 除互斥信号量外,所有类型的信号量都可以调用 xSemaphoreTake ...

  5. 【js】操作checkbox radio 的操作总结

    摘要 总是忘记checkbox radio 的具体操作,总是坑自己,总结下记下来 html <input type="checkbox" value="1" ...

  6. [BZOJ 2500] 幸福的道路

    照例先贴题面(汪汪汪) 2500: 幸福的道路 Time Limit: 20 Sec  Memory Limit: 256 MBSubmit: 368  Solved: 145[Submit][Sta ...

  7. 利用百度API(js),通过地址获取经纬度的注意事项

    网上给的很多答案都是这种: http://api.map.baidu.com/geocoder?address=地址&output=输出格式类型&key=用户密钥&city=城 ...

  8. python-继承类执行的流程

    在读python数据机构与算法, 发现了下面这个例子, 之前没有碰到过, 记录下来 In [17]: class A: def f(self): self.g() def g(self): print ...

  9. 记Angular与Django REST框架的一次合作(2):前端组件化——Angular

    注:这是这个系列的第二部分,主要集中在Angular的使用方面.之前使用过AngularJS(Angular 1.x),混在Django的模板中使用,这些页面一般完全是结果展示页.在有Django表单 ...

  10. python实战第一天-socket模块练习

    操作系统 Ubuntu 15.10 IDE & editor JetBrains PyCharm 5.0.2 ipython3 Python版本 python-3.4.3 导入socket模块 ...