1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
def odd_line(n):
for i in range(1,2*n):
if i%2==1 :
print('*',end='')
else : print(' ',end='')
def even_line(n):
for i in range(1,2*(n+1)):
if i%2==1 :
print(' ',end='')
else : print('*',end='')
n=int(input())
for i in range(1,n+1):
if i%2==1 :
odd_line(n)
else :
even_line(n)
print()
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
백준 24736 Football Scoring (0) | 2022.05.24 |
---|---|
codeforces 1669A - Division? (0) | 2022.05.24 |
codeforces 1619A - Square String? (0) | 2022.05.12 |
codeforces 1294A - Collecting Coins (0) | 2022.05.12 |
codeforces 785A - Anton and Polyhedrons (0) | 2022.05.12 |
댓글