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 [选项 ...
随机推荐
- SSH连不上虚拟机的问题解决
这几天工作任务不重,今早上班打算在liunx下运行下python脚本.打开VM,SSH突然连不上虚拟机了.网上试了很多方法都不行,最后花费2个小时解决了这一问题. 结合我的实际情况,问题解决如下: 1 ...
- getcomputedstyle()获取border像素差异问题
getComputedStyle()方法返回的是一个CSS样式声明对象--CSSStyleDeclaration对象(与style属性的类型相同),包含当前元素所有最终使用的CSS属性值: <! ...
- 【D3】cluster layout
一. 和其他D3类一样,layout 可以链式传递,使用简明的申明添加多种自定义设置. 二.API # d3.layout.cluster() Creates a new cluster layout ...
- 数据结构基础:栈(Stack)
什么是栈? 栈是限制插入和删除只能在同一个位置上进行的表,这个位置就是栈的顶端,对于栈的操作主要有三种形式:入栈(将元素插入到表中),出栈(将表最后的元素删除,也就是栈顶的元素),返回栈顶元素 ...
- 微信小程序开发基础知识总结
微信小程序在无论在功能.文档及相关支持方面,都是优于前面几种微信账号类型,它提供了很多原生程序才有的接口,使得我们的小程序在很多方面突破H5页面应用的限制,更加接近原生程序的功能,因此微信小程序具有很 ...
- bzoj3728: PA2014Final Zarowki
Description 有n个房间和n盏灯,你需要在每个房间里放入一盏灯.每盏灯都有一定功率,每间房间都需要不少于一定功率的灯泡才可以完全照亮. 你可以去附近的商店换新灯泡,商店里所有正整数功率的 ...
- LNMP环境的安装
一.LNMP的安装 1.准备工作 #清理已经安装包 rpm -e httpd rpm -e mysql rpm -e php yum -y remove httpd yum -y remove mys ...
- 防止DDoS攻击的方式
针对企业的DDoS攻击持续增长,根据Akamai的调查报告,2015年DDoS攻击增长了史无前例的180% !面对 DDoS 攻击性挑战,我们应该建立有效的防御体系来抵御攻击. 1.网站IP减少公 ...
- 47. leetcode 437. Path Sum III
437. Path Sum III You are given a binary tree in which each node contains an integer value. Find the ...
- Go语言学习笔记(七)杀手锏 Goroutine + Channel
加 Golang学习 QQ群共同学习进步成家立业工作 ^-^ 群号:96933959 Goroutine Go语言的主要的功能在于令人简易使用的并行设计,这个方法叫做Goroutine,通过Gorou ...