Alibabacloud.com offers a wide variety of articles about print multiplication table, easily find your print multiplication table information here online.
Find the maximumint [] array={1,5,7,6};for (int i = 0; i for (int j = 0; J if (Array[j]>array[j+1]) {int TEMP=ARRAY[J];ARRAY[J]=ARRAY[J+1];Array[j+1]=temp;}}}System.out.println ("-------");for (int i = 0; i System.out.println (Array[i]);}Bubble sortint array[]={1,3,2,7,5,9};for (int i = 0; i for (int j = 0; J if (Array[j]>array[j+1]) {int TEMP=ARRAY[J];ARRAY[J]=ARRAY[J+1];Array[j+1]=temp;}}}After sortingfor (int i = 0; i System.out.println (Array[i]);}Print
' For I in Range ' (1,10):For j in Range (1,10):Print I, ' * ', j, ' = ', i*j, ',‘‘‘‘‘‘For a in range (1,10):For b in Range (1,10):#print A, ' * ', b, ' = ', a*b, ',print '%d*%d=%d '% (a,b,a*b),print ' \ n 'For M in range (1,10):For n in range (1,m+1):print '%d*%d=%d '% (n,m
=8 3*4=12 4*4=161*5=5 2*5=10 3*5=15 4*5=20 5*5=251*6=6 2*6=12 3*6=18 4*6=24 5*6=30 6*6=361*7=7 2*7=14 3*7=21 4*7=28 5*7=35 6*7=42 7*7=491*8=8 2*8=16 3*8=24 4*8=32 5*8=40 6*8=48 7*8=56 8*8=641*9=9 2*9=18 3*9=27 4*9=36 5*9=45 6*9=54 7*9=63 8*9=72 9*9=81Two. Print * is the full shape of the following graphic. But no limit to the number of starsFigure 1 Effects*************************Figure 2 Effects*********Figure 3 Effects*********Final show Diamond***
Today in three different ways to achieve the shell script Print 99 multiplication table, the code is as follows Method 1: Use a For loop (a.sh) #!/bin/shfor i in {1,2,3,4,5,6,7,8,9}do to J in {1,2,3,4,5,6,7,8,9} do ((product= $i * $j)) Echo-ne $i \ * $j = $product "\ T" done Echodoneexit 0 Method 2: Use the While loop (b.sh) #!/bin/shi=1j=1while ["$i"-ne]do while
This is a childhood back of the 99 multiplication table, is the Chinese version, not the digital version, with the Java program printed out.The Java source program is as follows:Package Com.elephant.multiply99table;public class Multiply99table {public static String Convert (int digit) {string[] Digitwords = {"Ten", "One", "two", "three", "four", "five", "six", "seven", "eight", "Nine"};if (Digit The result
From the National Day holiday to today, "linux Command Line and advanced shell programming" has initially learned chapter 10. Basically, I can write some simple process control scripts. Today, an unexpected whim occurred, trying to create a multiplication table of 9*9. After thinking for a long time, I finally got the result. However, it is not mature enough. Then I asked a few friends in the group. I learn
The shell script calls the jar package to print the multiplication table, shelljar
# Declaration script
#! /Bin/bash
# Print "------ cfb ---------"Echo "------ cfb ---------"
# Java environment variablesJAVA_HOME =/usr/java/jdk1.8.0 _ 11CLASSPATH = $ JAVA_HOME/bin
# Specify the location where the jar package needs
The point is,end= "" means that the next print does not wrap.Instance:1 forXinchRange (1,10):2 forYinchRange (1,10):3 ifx>=y:4 Print(X,"x"Y"=", X*y," ", end="")5 Print()Output results1 x 1 = 1 2 x 1 = 2 2 x 2 = 4 3 x 1 = 3 3 x 2 = 6 3 x 3 = 9 4 x 1 = 4 4 x 2 = 8 4 x 4 = 5 x 1 = 5 5 x 2 = 5 x 3 = 5 x 4 = 5 x
#! /usr/bin/env python#coding =utf-8s = "{0} x {1}={2}"For I in range (1,10):Print ""For J in Range (1,i+1):print S.format (i,j,i*j), Results:1 x 1=12 x 1=2 2 x 2=43 x 1=3 3 x 2=6 3 x 3=94 x 1=4 4 x 2=8 4 x 3=12 4 x 4=165 x 1=5 5 x 2=10 5 x 3=15 5 x 4=20 5 x 5=256 x 1=6 6 x 2=12 6 x 3=18 6 x 4=24 6 x 5=30 6 x 6=367 x 1=7 7 x 2=14 7 x 3=21 7 x 4=28 7 x 5=35 7 x 6=42 7 x 7=498 x 1=8 8 x 2=16 8
For I in range (1, 10 ):If I! = 1:Print ('') # This is actually to print a \ n line feed.For k in range (1, 10 ):If I Ans = STR (I * K)If Len (ANS) = 1: # Write a judgment for the good-looking format. If the result is a single digit, it will be null. If it is not a single digit, it will not be empty.Print ('{}* {}='. Format (I, K) + ''+ STR (I * k), end = '')Else:Print ('{}* {}='. Format (I, K) + STR (I * k
#声明脚本#!/bin/bash#打印 "------CFB---------"echo "------CFB---------"#java环境变量Java_home=/usr/java/jdk1.8.0_11Classpath= $JAVA _home/bin#指定需要执行jar包的位置, you can set your ownJarpath=/home/haha/desktop#环境变量的标准格式Classpath= $CLASSPATH: $JARPATH/cfb.jar#export用来设置或者新增环境变量, and is limited to this logon operation, do not write, can not find the main classExport Classpath= $CLASSPATH#打印环境变量Echo $CLASSPATH#执行jingdian. The main method in the Cfbdemo classjava-xms50m-xmx250m Jingdian. Cfbdemo#退出ExitFinal
Code public
class Mian3 {
//recursive print multiplication table public
static void Main (string[] args) {line
(9);
}
Loops a few lines of public
static void line (int lines) {
if (Row
Package com.hcq.day;
public class Main2 {public
static void Main (string[] args) {
test (9);
}
public static void Test (int i) {
if (i
screenshot:
Print a 99 multiplication table with a for loop
public class Multiply {public
static void Main (String args[]) {for
(int i = 1; I
Single Loop implementation
int j = 1;
for (int i = 1; I
Nonsense not much to say, directly on the code!!The code is as follows: for (var i =1; i) { for (var j =1;j) { document.write ( I+ "*" +j + "=" + (i*j) + ' nbsp; ' ); } document.write (' ); }Resolution: The outer loop is 1 to 9,The inner loop is the printing of each layer,For example: When printing to the first layer: JThe effect is as follows:JavaScript-based print multiplic
This is a child back of the 99 multiplication table, is the Chinese version, not a digital version, with a Java program to print out.The Java source program is as follows:
Package com.elephant.multiply99table;
public class Multiply99table {public
static String Convert (int digit) {
string[] digitwords = {"Ten", "One", "two", "three "," Four "," five ",
Recursive implementation:
private static void multitable (int n) {
if (n = = 1) {
System.out.println ("1*1=1");
} else {
//put recursive call before output To ensure that the multiplication table is a positive
multitable (n-1);
for (int i = 1; I
Loop implementation:
Loop implementation of a
System.out.println ("Loop implementation One");
for (int i = 1; I
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.