编程打印如下图所示的几何图形。
1个回答
关注
展开全部
倒等腰三角形:```size = int(input("请输入倒等腰三角形边长:"))for i in range(size): for j in range(i): print(" ", end="") for j in range(2*(size-i)-1): print("*", end="") print()```平行四边形:```width = int(input("请输入平行四边形宽度:"))height = int(input("请输入平行四边形高度:"))for i in range(height): for j in range(width-i-1): print(" ", end="") for j in range(width): print("*", end="") print()```棱形:```size = int(input("请输入棱形边长:"))for i in range(size): for
咨询记录 · 回答于2024-01-05
编程打印如下图所示的几何图形。
您好,请问您需要打印哪种几何图形呢?
亲您好,已经帮你查询到结果:编程打印的的几何图形,正方形,正直角三角形,倒直角三角形,正等腰三角形,倒等腰三角形,平行四边形,棱形,结束ChatAI您好,以下是Python语言的示例代码: 正方形: ``` size = int(input("请输入正方形边长:")) for i in range(size): for j in range(size): print("*", end=" ") print() ``` 正直角三角形: ``` size = int(input("请输入直角三角形边长:")) for i in range(size): for j in range(
您好,以下是Python语言的示例代码: 正方形: ``` size = int(input("请输入正方形边长:")) for i in range(size): for j in range(size): print("*", end=" ") print() ``` 正直角三角形: ``` size = int(input("请输入直角三角形边长:")) for i in range(size): for j in range(i+1): print("*", end=" ") print() ``` 倒直角三角形: ``` size = int(input("请输入倒直角三角形边长:")) for i in range(size): for j in range(size-i): print("*", end=" ") print() ``` 正等腰三角形: ``` size = int(input("请输入等腰三角形边长:")) for i in range(size): for j in range(size-i-1): print(" ", end="") for j i
倒等腰三角形:```size = int(input("请输入倒等腰三角形边长:"))for i in range(size): for j in range(i): print(" ", end="") for j in range(2*(size-i)-1): print("*", end="") print()```平行四边形:```width = int(input("请输入平行四边形宽度:"))height = int(input("请输入平行四边形高度:"))for i in range(height): for j in range(width-i-1): print(" ", end="") for j in range(width): print("*", end="") print()```棱形:```size = int(input("请输入棱形边长:"))for i in range(size): for
答案有点长,分两部分发送希望我的回答对你有所帮助