The 1 script is as follows[[email protected] ~]# vim 99.sh #!/bin/bash # 9*9 Table # 2015.5.26 by Luzhi for i ' {1..9}do for J ' {1..9} do If [$j-le $i] then c=$ (($i * $j)) ECHO-E-n "$j * $i = $c \ T" fi do echo "" Done2 Operating effect650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6D/76/wKiom1VkjluAEf4kAAFZHpoDIUI736.jpg "title=" 99.png "alt=" Wkiom1vkjluaef4kaafzhpodiui736.jpg "/>This article is from the "Tiandaochouqin" blog, make sur
1 #1*1 = 12 #1*2 = 2 2*2 = 43 #1*3 = 3 2*3 = 6 3*3 = 94 5i = 16j = 17 forJinchRange (1,10):8 forIinchRange (1,j +1):9 Print('%s*%s=%s'% (i,j,i*j), end="')Ten #print (J, ' * ', I, ' = ', I*j,end = ') One Print("')Record the problem you are experiencing:1, for I in J: #报错 TypeError: ' int ' object was not iterable type error int This type object is non-iterative, Can iterate over range, this question is2, print in the method of printing and C language is different, re
shell:a99.sh#!/bin/bashfor ((i=1;iPython:a99.py#!/usr/bin/pythonimport sysfor i in Range (1,10): for J in Range (1,i+1): Print ("%d*%d=%d"% (i,j,i*j))A good example of learning loop statements.This article is from "[[email protected] Prof. Open ~] #rm-rf/" blog, please be sure to keep this source http://luweikai.blog.51cto.com/1705672/1785761Shell/python implementation of the 99 multiplication table
The example in this paper describes how Python outputs the 9*9 multiplication table. Share to everyone for your reference. The implementation method is as follows:
#!/usr/bin/env python# 9 * 9for i in range (1, ten): print for J in range (1, i+1): print "%d*%d=%d"% (i, J, I*j ),
Add an easier way:
The code is as follows:
Print (' \ n '. Join (["%d*%d=%2s"% (y,x,x*y) for Y in range (1,x+1)]))
The 9-9 multiplication table is generally a triangle, with each number and the for (I = 1; I
The Code is as follows:
I, j, n = 9 "* |" "1" (I = 2; I
Effect
Publicclasschengfabiao{publicstaticvoidmain (String []args] {for (inti=1;iThis article is from the "Programmer's Learning Day" blog, so be sure to keep this source http://laiyicong.blog.51cto.com/10811813/1712222Java 99 multiplication Table
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 multiplication
This article mainly introduces PHP double-layer loop implementation 99 multiplication table, interested in the friend's reference, I hope to help you.
Examples are as follows:
"Run Results"
If there is only one sentence inside the curly brace, you can remove the curly brace, #include Number one represents the number of rows that can prove:99 multiplication Table Double cycle
1
One
The interfaces are:
The rule is: Check the trend of the 9-9 multiplication table, determine the for loop of the outermost layer, and check the column changes: from 1 to 9, or 9 to 1.
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.