arrow_forward همه ارسال‌ها

جزئیات ارسال کد#862

code_blocks
مسئله مربوطه: الماس (#35) arrow_outward
verified
وضعیت داوری نهایی: پذیرفته شد
terminal
زبان برنامه‌نویسی: Python
schedule
ارسال‌کننده و زمان:
Amir Mohammad Baghche sara (۱۰ ماه پیش)
descriptionsolution.py ۱۴ خط • ۲۱۳ بایت
1n=int(input())
2m = n//2
3
4def line(n,i):
5 s = 2 * i -1
6 e = int( (n - s) / 2 )
7 line = e * " "+ s * "*" + e * " "
8 print(line)
9
10
11for i in range(1,m+2):
12 line(n,i)
13for i in range(m+2,n+1):
14 line(n,n-i+1)
کد ارسال‌شده برای داوری خودکار هاتکدز UTF-8