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 [选项 ...
随机推荐
- 分享网上搜到的Oracle中对判定条件where 1=1的正解
今天在网上找到了Oracle中对判定条件where 1=1的正解,粘贴出来和大家分享下 1=1 是永恒成立的,意思无条件的,也就是说在SQL语句里有没有这个1=1都可以. 这个1=1常用于应用程序根据 ...
- AllPairs运用遇到的问题及解决办法分享
前些天用AllPairs自动生成了交互式测试用例,中间遇到的问题困扰了一天,最后解决了.现在分享下解决过程 首先,D\AllPairs是我的ALLPairs安装目录,C盘桌面test.txt是我写的测 ...
- Oozie时出现Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure?
不多说,直接上干货! 问题详情 [hadoop@bigdatamaster oozie--cdh5.5.4]$ bin/ooziedb.sh create -sqlfile oozie.sql -ru ...
- 函数响应式编程及ReactiveObjC学习笔记 (-)
最近无意间看到一个视频讲的ReactiveObjC, 觉得挺好用的 但听完后只是了解个大概. 在网上找了些文章, 有的写的比较易懂但看完还是没觉得自己能比较好的使用RAC, 有的甚至让我看不下去 这两 ...
- Linux基础(八)
一.shell shell一般代表两个层面的意思,一个是命令解释器,比如BASH,另外一个就是shell脚本.Python也是一种解释语言. 1. Linux中命令是按照下面的优先级执行的 ==& ...
- Actor模型原理
1.Actor模型 在使用Java进行并发编程时需要特别的关注锁和内存原子性等一系列线程问题,而Actor模型内部的状态由它自己维护即它内部数据只能由它自己修改(通过消息传递来进行状态修改),所以使用 ...
- 【SpringMVC】【EasyUI】关于使用EasyUIForm上传文件,返回JsonIE提示下载文件的解决办法!
先说一下环境 EasyUI+SpringMVC+MyBatis 因为按正常手段,无法使用Ajax来提交一个包含文件的表单,故想到利用EasyUI的Form来提交,EasyUI的form封装了一套伪Aj ...
- Spring boot——logback 基础使用篇(一)
1 简单日志配置 spring boot内部使用Commons Logging来记录日志,但也保留外部接口可以让一些日志框架来进行实现,例如Java Util Logging,Log4J2还有Logb ...
- foreach是怎么实现遍历的
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using S ...
- css 为元素选择器,css目标状态伪类,结构化选择器,多媒体选择器,清除表默认样式、属性选择器
伪元素选择器 :before 和 :after 添加的位置 :before --- 第一个子节点 :after --- 最后一个子节点 特点 1.默认是 inline 元素 2.必须包含 conten ...