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 [选项 ...
随机推荐
- 关于SurfaceView的那些事
今天来说说SurfaceView吧 这东西的特性大家记住一个就行了,它的绘制是在子线程中,所以不堵塞UI,非常适合一些复杂的绘制 SuufaceView有一个重要的对象,是SurfaceHolder, ...
- 基于 WebRTC 技术的实时通信服务开发实践
随着直播的发展,直播实时互动性变得日益重要.又拍云在 WebRTC 的基础上,凭借多年的开发经验,结合当下实际情况,开发 UPRTC 系统,解决了网络延时.并发量大.客户端解码能力差等问题. WebR ...
- 一个简单的java贷款程序
代码如下: //计算贷款package ClassDemo;import javax.swing.JOptionPane; public class ComputeLoan { public stat ...
- 以Random Forests和AdaBoost为例介绍下bagging和boosting方法
我们学过决策树.朴素贝叶斯.SVM.K近邻等分类器算法,他们各有优缺点:自然的,我们可以将这些分类器组合起来成为一个性能更好的分类器,这种组合结果被称为 集成方法 (ensemble method)或 ...
- hdu_1695: GCD 【莫比乌斯反演】
题目链接 这题求[1,n],[1,m]gcd为k的对数.而且没有顺序. 设F(n)为公约数为n的组数个数 f(n)为最大公约数为n的组数个数 然后在纸上手动验一下F(n)和f(n)的关系,直接套公式就 ...
- python函数(3):装饰器
昨天学了很多函数方面的概念和知识其中有一个闭包的函数.很多人都对闭包的作用不是很清楚,今天我们就来认识一个新的知识点装饰器.它就是闭包函数的一个经典应用. 预习: 编写装饰器,为多个函数加上认证的功能 ...
- Redis作为消息队列服务场景应用案例(入队和出队)
http://www.cnblogs.com/leo_wl/p/3831349.html
- 2013年五大主流浏览器 HTML5 和 CSS3 兼容性大比拼
2013年五大主流浏览器 HTML5 和 CSS3 兼容性大比拼 转眼又已过去了一年,在这一年里,Firefox 和 Chrome 在拼升级,版本号不断飙升:IE10 随着 Windows 8 在 ...
- AJAX基础_AJAX获取PHP数据
前言 本篇AJAX基础教程,只讲干货,拒绝废话. 全文通过两个实例来讲解AJAX的基本用法,第1个实例是使用AJAX技术从服务器获取纯文本(HTML)数据, 第2个实例是获取从服务器PHP文件的数据. ...
- Ant 之bulid.xml详解
ANT build.xml文件详解(一) Ant的概念 可能有些读者并不连接什么是Ant以及入可使用它,但只要使用通过Linux系统得读者,应该知道 make这个命令.当编译Linux内核及一些软件的 ...