print('九九乘法表:') for x in range(1,10): for y in range(1,x+1): # for y in range(1,10): print(x,'*',y,"=",x*y,end='t') print() print('九九乘法表倒序:') for x in range(9,0,-1): #987654321 # print(x,end='') for y in range(1,x+1): print(x,'*',y,"=",x*y,end='t') print()
print('while实现九九乘法表:') i = 1 while i < 10: j = 1 while j < i+1: print(i, '*', j, '=', i * j, end='t') j += 1 i += 1 print() print('while实现九九乘法表倒序:') i = 9 while i >= 1: j = 1 while j<=i: print(i, '*', j, '=', i * j, end='t') j += 1 print() i -= 1
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)