Copy Code code as follows:
@echo off
:: 99 Multiplication table
Set num=0
FOR/L%%i in (1,1,9) do (
FOR/L%%j in (1,1,%%i) do call:multiply%%i
)
Pause>nul
Goto:eof
: Multiply
set/a num+=1
set/a var=%1*%2
Set var=%2x%1=%var%
Set var=%var%
If%2 equ 1 (set var=%var:~0,5%) Else set var=%var:~0,6%
Set str=%str%%var%
If%num% equ%1 echo%str%set str=set num=0
Goto:eof
:: Another, with the TA
Note: Daniel Bypass, write the people do not spit AH ~99 multiplication Table Presumably everyone is aware of, then how to apply PHP code to achieve such a multiplication table?Implementation effect:
The following is the implementation of the Code, please new people consciously, understand the brain first, the way t
Print 99 multiplication tableFor Loop statement implementation:1 forIinchRange (1,10):2 forJinchRange (1,10):3 Print(J,"x"I"=", I*j,"\ t", end="")#end= "" is not wrapped because of print wrap line4 ifi==J:5 Print("")#here is the end of line wrapping6 BreakWhile loop statement implementation:1I=02j=03 whileI :4I+=15 whileJ :6J + = 17 Print(J,"x"I"=", I * j,"\ t", end="")8 ifi==J:9
Read a lot of on-line multiplication formula printing, feel a lot of writing is not suitable for beginners to understand, today reference a few small examples, wrote this small script, hope to learn the novice look at this, understand Python in the while statement will have some help.I wrote each line to help see, you can directly copy a piece of code to run, the content or there are so many aspects, directly put the code here.#encoding =GBK‘‘‘The cod
This article mainly introduces how Python outputs 9*9 multiplication tables and provides two common methods for your reference, for more information about how to output a 9*9 multiplication table in Python, see the following example. Share it with you for your reference. The specific implementation method is as follows:
#! /Usr/bin/env python #9 * 9for I in
CopyCode The Code is as follows: @ echo off
: 9-9 multiplication table
Set num = 0
For/L % I in (1, 1, 9) Do (
For/L % J in (1,1, % I) Do call: multiply % I % J
)
Pause> NUL
Goto: EOF
: MultiplySet/a num + = 1Set/A Var = % 1 * % 2Set Var = % 2 × % 1 = % var %Set Var = % var %If % 2 equ 1 (set Var = % var :~ 0, 5%) else set Var = % var :~ 0, 6%Set STR = % STR % var %If % num % equ % 1 echo % STR % set S
Line$a = "*";Echo ("$a One line of 50 *for ($j =1; $j echo "$a";}echo "5 Rows 10 Columnsfor ($i =1; $i Echo (' * ');if ($i%10==0) {Echo (' }}99 Multiplication TableFirst loop, declare variable i, loop 9 times, add 1 to Each loopfor ($i =1; $i {//When there are multiple lines inside the statement to use {}.Second loop, declaring the variable J, the number of cycles will depend on the current value of Ifor ($j =1; $j echo "}?>PHP
The main implementation of the function is to click the end of the button, the page Printing 99 multiplication table.The version of jquery used is 1.10.2"Java"Contenttype="text/html; Charset=utf-8"pageencoding="Utf-8"%>"-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD">"Content-type"Content="text/html; Charset=utf-8">"showtable">"Mul"> Click Show jquery implements the dynamic display of the 99
Print 99 multiplication tableFor Loop statement implementation:For I in Range (1,10): A for J in range (1,10): print (J, "X", I, "=", i*j, "\ T", end= "") #因为print自动换行, end= "" ending with no newline if i==j: print ("") #此处是结尾换行 breakWhile loop statement implementation:I=0j=0while i Output Result:1 x 1 = 1 1 x 2 = 2 2 x 2 = 4 1 x 3 = 3 2 x 3 = 6 3 x 3 = 9 1 x 4 = 4 2 x 4 = 8 x 3 = 4 x 4 = 4 1 x 5 = 5 3 x 5 = 4
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 a positive trianglefor (int i = 0; i f
Program run:The code is as follows:PHP//99 multiplication TableEcho"; for($i= 1;$i$i++){ Echo"; for($j=$i;$j$j++){ Echo"$i*$j=".$i*$j." nbsp; "." ; } for($k=$i;$k>1;$k--){//This loop is used to fill out empty tables Echo"; } Echo";}Echo"Outer loop control line, inside loop output line.PHP Writing 99 multiplication table
In this paper, we illustrate the method of JavaScript realization of trapezoidal multiplication table. Share to everyone for your reference. Specifically as follows:
The effect is shown in the following illustration:
The table is table,tr,td in HTML and then implemented with a for statement, loops out rows and colu
99 multiplication table in the first quadrant# #一for I in Range (1,10): to J in range (1,10): If J Second Quadrant# #二 # for X in range (1,10): # Print (end= "* (9-x)) # for K in range (1,10): # y=10-k# if y Third QuadrantFor I in Range (1,10): for K in Range (1,i): Print (end= "") for J in Range (i,10): Print ("%d * %d =%2d "% (i,j,i*j), end=") print ("")Quadrant Four#四for i in range (1,10): X=10-i for J i
Recently, I was going to review the shell, just to see the shell operation, and to write a simple 99 multiplication table like a beginner. It is suggested that you can run shell scripts directly in Http://www.runoob.com/try/runcode.php?filename=helloworldtype=bash if you do not want to install Linux environments.First, the previous code#!/bin/bash#使用while循环I=1;While [$i-le 9];d o #-le means less than or equ
99 multiplication table is also a lot of interview test procedures, to examine the PHP interviewer's logical thinking ability, is mainly the understanding of the algorithm and application, the following is a small series of PHP written in the output of 99 multiplication formula PHP code:
After seeing, is not very simple, is two loops, the outer control l
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.