#반복제어문3 - 자가진단1
n=int(input())
su=0
i=1
while True:
  su+=i
  if su>=n:
    print("%d %d %d" %(i, i//2+1, su))
    break
  i+=2​
#반복제어문3 - 자가진단3

n=int(input())
for i in range(1, n+1):
  for j in range(n-i+1, 0, -1):
    print("*",end="")
  print(" ")
for i in range(1, n+1):
  for j in range(1, i+1):
    print("*",end="")
  print(" ")​
#반복제어문3 - 자가진단2
n=int(input())
for i in range(1, n+1):
  for j in range(1, i+1):
    print("*",end="")
  print(" ")
#554 : 반복제어문3 - 자가진단7
n=int(input())
ai="A"
k=1
for i in range(1, n+1):
  for _ in range(n-i+1):
    print(k, end=" ")
    k+=1
  for _ in range(i):
    print(ai, end=" ")
    ai=chr(ord(ai)+1)
  print("")​
#143 : 반복제어문3 - 형성평가4
n=int(input())
for i in range(n*2-1, -1, -2):
  for j in range((n*2-1-i)//2):
    print(" ",end="")
  for k in range(i):
    print("*",end="")
  print("")
for i in range(3, n*2+1, 2):
  for j in range((n-i+2)//2):
    print(" ",end="")
  for k in range(i):
    print("*",end="")
  print("")
#141 : 반복제어문3 - 형성평가2
n=int(input())
for i in range(1, 101):
  if((n*i)%10==0):
    print(n*i, end=" ")
    break
  else:
    print(n*i, end=" ")​
#142 : 반복제어문3 - 형성평가3
n=int(input())
for i in range(1, n+1):
  for _ in range(i):
    print("*",end="")
  print("")
for i in range(1, n):
  for _ in range(n-i):
    print("*",end="")
  print("")
#140 : 반복제어문3 - 형성평가1
n=list(map(int,input().split()))
sum1=0
ti=0
for i in n:
  if(i==0):
    break
  if(ti==20):
    break
  else:
    sum1+=i
  ti+=1
print("%d %d" %(sum1, sum1//ti))

 

#140 : 반복제어문3 - 형성평가1
n=list(map(int,input().split()))
sum1=0
#ti=0
for ti, i in enumerate(n):
  print(ti, i)
  if(i==0):
    break
  if(ti==20):
    break
  else:
    sum1+=i
  #ti+=1
print("%d %d" %(sum1, sum1//ti))
#553 : 반복제어문3 - 자가진단6
n=int(input())
al="A"
for i in range(n):
  for j in range(n-i,0,-1):
    print(al,end="")
    al=chr(ord(al)+1)
  print(" ")
#반복제어문3 - 자가진단4

n=int(input())
for i in range(1, n+1):
  for k in range(0, i-1):
    print(" ",end="")
  for j in range(n-i+1, 0, -1):
    print("*",end="")
  print(" ")

'정보올림피아드-KOI > 기초 문법 문제' 카테고리의 다른 글

숫자삼각형 (종류3)  (0) 2021.01.24
반복제어문2 - 파이썬  (0) 2021.01.10
#큰수의 법칙 - Python  (0) 2021.01.10
큰수의 법칙  (0) 2021.01.10
1901 : 소수 구하기  (0) 2020.12.29

+ Recent posts