C#打印九九乘法表
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#打印九九乘法表的更多相关文章
- scala打印九九乘法表的5种实现
使用scala打印九九乘法表,可以有多种实现方法,实现的过程充分的体现的scala语言的优势和巨大的简洁性和高效性, 下面我用了5种方法实现九九乘法表. 使用类似于java,c++等指令风格的的编程实 ...
- 利用Python循环(包括while&for)各种打印九九乘法表
一.for循环打印九九乘法表 #注意:由于缩进在浏览器不好控制,请大家见谅,后续会有图片传入. 1.1 左下角 for i in range(1,10): for j in range(1,i+1): ...
- 写一个方法,用一个for循环打印九九乘法表
public class MultiplicationTable { /** * @description 写一个方法,用一个for循环打印九九乘法表 * @author wangkun * ...
- python脚本7_打印九九乘法表
#打印九九乘法表 for i in range(1,10): s = "" for j in range(1,i+1): s += str(j) + '*' + str(i) + ...
- python—用for循环、while循环和一句话打印九九乘法表
用for循环打印九九乘法表: for i in range (1,10): for j in range(1,10): print(j,"x",i,"=",i* ...
- 【Java】Java_15 打印九九乘法表
使用For循环嵌套即可打印九九乘法表 以下是具体代码: /** * 打印九九乘法表 */ package com.oliver.test; public class TestMultiplicatio ...
- 使用whIle循环语句和变量打印九九乘法表
-设置i变量declare @i int --设置j变量declare @j int --设置乘法表变量declare @chengfabiao varchar(1000)--给i,j,@chengf ...
- python3 打印九九乘法表
打印九九乘法表 # !/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan for i in range(1, 10): fo ...
- 【shell脚本】打印九九乘法表
打印九九乘法表 一.seq介绍 seq命令用于以指定增量从首数开始打印数字到尾数,即产生从某个数到另外一个数之间的所有整数,并且可以对整数的格式.宽度.分割符号进行控制 语法: [1] seq [选项 ...
随机推荐
- Sass学习笔记(补充)
阅读目录 1. Sass和SCSS的区别 2. @while循环 3. @at-root 4. @content 5. 凸显注释 6. CSS输出样式 7. 重置浏览器样式 8. Sass调试和@de ...
- maven - 引用本地jar,进行jar包移动
背景: 项目为maven工程,部分jar需要需用项目单独修改的本地jar包. 配置好scope后发现构建后引用的jar没有移动到对应的目录,百度后发现需要配置以下依赖 <plugin> & ...
- 设计模式--单例模式(Singleton pattern)及应用
单例模式 参考文档: 该文仅介绍spring的单例模式:spring 的单例模式 介绍原理:Spring的单例模式底层实现 参考书籍:漫谈设计模式:从面向对象开始-刘济华.pdf 1. 单例模式解析 ...
- juquery 中 size()和length的区别 以及优缺点
size()是jQuery提供的函数,而length是属性(不带括号).jQuery提供的源代码是这样的:size: function() {return this.length;}其实也就是说,在j ...
- 终极锁实战:单JVM锁+分布式锁
目录 1.前言 2.单JVM锁 3.分布式锁 4.总结 =========正文分割线================= 1.前言 锁就像一把钥匙,需要加锁的代码就像一个房间.出现互斥操作的场景:多人同 ...
- Java IO(一):IO和File
一.IO 大多数的应用程序都要与外部设备进行数据交换,最常见的外部设备包含磁盘和网络.IO就是指应用程序对这些设备的数据输入与输出,Java语言定义了许多类专门负责各种方式的输入.输出,这些类都被放在 ...
- LayUI分页,LayUI动态分页,LayUI laypage分页,LayUI laypage刷新当前页
LayUI分页,LayUI动态分页,LayUI laypage分页,LayUI laypage刷新当前页 >>>>>>>>>>>> ...
- Android学习笔记-EditText(输入框)(一)
1.设置默认提示文本 默认提示文本的两个属性如下: android:hint="默认提示文本" android:textColorHint="#95A1AA" ...
- centos 7 下面安装oracle 11g r2 过程分享
本人对LINUX等很多还不熟悉,如果有不对的地方还请各位指正.谢谢. 打算学习下ORACLE,RMAN备份与还原功能,所以安装了虚拟机,用的是centos7 X86_64-1611版本,oracle用 ...
- Linux系统C语言socket tcp套接字编程
1.套接字的地址结构: typedef uint32_t in_addr_t; //32位无符号整数,用于表示网络地址 struct in_addr{ in_addr_t s_addr; //32位 ...