Commit 545e99d8 by BellCodeEditor

auto save

parent 10af1cba
Showing with 13 additions and 0 deletions
n=int(input("请输入n:"))
sum=0
if n==1:
print("第"+str(n)+"个图形有4个火柴组成。")
else:
i=3
while i<=(n+1):
sum+=i
i+=1
print("第"+str(n)+"个图形有"+str(2*sum+4)+"个火柴组成。")
\ No newline at end of file
i = 5 # 行 i = 5 # 行
j = 3 # 列 j = 3 # 列
# 使用变量i和j,代替乘法算式里面的元素,打印出单个乘法算式 # 使用变量i和j,代替乘法算式里面的元素,打印出单个乘法算式
print(j,'*',i,'=',i*j)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment