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

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

code_blocks
مسئله مربوطه: الماس (#35) arrow_outward
verified
وضعیت داوری نهایی: پذیرفته شد
terminal
زبان برنامه‌نویسی: Python
schedule
ارسال‌کننده و زمان:
melisa azadi (۱ سال پیش)
descriptionsolution.py ۳۷ خط • ۵۶۸ بایت
1n = int(input())
2
3x = n // 2 + 1
4y = 1
5fasele = n // 2
6
7while x > 0:
8 z = 0
9 zz = 0
10 while fasele > zz:
11 print(" ", end="")
12 zz += 1
13 while y > z :
14 print("*", end="")
15 z += 1
16 print()
17 x -= 1
18 y += 2
19 fasele -= 1
20
21xx = n // 2
22fasele2 = 1
23tedad = n - 2
24while xx > 0:
25 mm = 0
26 mmm = 0
27 while fasele2 > mm:
28 print(" ", end="")
29 mm += 1
30 while tedad > mmm:
31 print("*", end="")
32 mmm += 1
33
34 print()
35 fasele2 += 1
36 tedad -= 2
37 xx -= 1
کد ارسال‌شده برای داوری خودکار هاتکدز UTF-8