打印九九乘法表

2020-01-16 15:44:41 浏览数 (1)

代码语言:javascript复制
 1 line =9
 2 while line >0:
 3     #print ("*")
 4     tmp =line
 5     while tmp >0:
 6         print ("#",end="")
 7         tmp-=1
 8     line -=1
 9     print()
10     
11 first  =0
12 while first <=9:
13     sec =1
14     while sec <= first:
15         print (str(sec)   "*"   str(first)   "="  str(sec * first) , end ="t")
16         sec  =1
17     first  =1
18     print ()

View Code

0 人点赞