摘要:
[root@python ~]# vim 9*9.sh #!/bin/bash for ((i=1;i<=9;i++));do for ((j=1;j<=i;j++));do if ( [ $j -eq 2 ] && [ $(($i*$j)) -eq 6 ] ) || ( [ $j -eq 2 ] && [ $(($i*$j)) -eq 8 ] ) then echo ... 阅读全文
摘要:
矩形边框: [root@python py]# vim biankuan.py #!/usr/bin/env python3 line = int(input("请输入一个数字: ")) for i in range(line): if i == 0 or i == line-1: for j in range(line): print("... 阅读全文
摘要:
梯形: [root@python py]# vim tx.py #!/usr/bin/env python3 line = int(input("请输入梯形底边的整数: ")) shang = int(input("请输入梯形上边的整数: ")) for i in range(shang,line+1): for k in range(line-i): prin... 阅读全文
摘要:
菱形 [root@python py]# vim lx.py #!/usr/bin/env python3 line = int(input("请输入一个整数: ")) for i in range(1,line+1): print(" "*(line-i),"*"*(i*2-1)) for i in range(1,line): print(" "*i,"*"*(2*... 阅读全文
摘要:
等腰三角形: [root@python py]# vim jzt.py #!/usr/bin/env python3 line = int(input("请输入一个整数: ")) for i in range(1,line+1): for k in range(line-i): print(" ",end="") for j in range(i*2-1... 阅读全文
摘要:
1.使用*打印一个矩形 [root@python py]# vim jx.py #!/usr/bin/env python3 hang = int(input("请输入一个数字: ")) lie = int(input("请输入一个数字: ")) for i in range(hang): for j in range(lie): print("*",end=""... 阅读全文