print("Hello")
print("Hello", "World")
print("Hello")
print("World")
print("'Hello'");
print('"Hello World"')
print("\"!@#$%^&*()\'")
print("\"C:\\Download\\\'hello\'.py\"")
print('print(\"Hello\\nWorld\")')
c = input()
print(c)
n = input()
n = int(n)
print(n)
f = input()
f = float(f)
print(f)
a = input()
b = input()
print(a)
print(b)
a = input()
b = input()
print(b)
print(a)
f = input()
f = float(f)
print(f)
print(f)
print(f)
a, b = input().split()
print(a)
print(b)
a,b = input().split()
print(b,a)
s = input()
print(s, s, s)
a, b = input().split(':')
print(a, b, sep=':')
y, m, d = input().split('.')
print(d,m,y,sep='-')
a,b = input().split('-')
print(a+b)
s = input()
print(s[0])
print(s[1])
print(s[2])
print(s[3])
print(s[4])
s = input()
print(s[0:2], s[2:4], s[4:6], sep=' ')
h, m, s = input().split(':')
print(m)
a, b = input().split()
print(a+b)
a, b = input().split()
a=int(a)
b=int(b)
c=a+b
print(c)
a=input()
b=input()
a=float(a)
b=float(b)
c=a+b
print(c)
a=input()
a=int(a)
print("%x"%a)
a=input()
a=int(a)
print("%X"%a)
a=input()
a=int(a,16)
print("%o"%a)
n=input()
n=ord(n)
print(n)
c=input()
c=int(c)
print(chr(c))
a=int(input())
print(-a)
n1=input()
n2=ord(n1)+1
s=chr(n2)
print(s)
a, b = input().split()
c = int(a)-int(b)
print(c)
f1, f2 = input().split()
m = float(f1)*float(f2)
print(m)
w, n = input().split()
print(w*int(n))
n = input()
s = input()
print(int(n)*s)
a, b = input().split()
c = int(a)**int(b)
print(c)
f1, f2 = input().split()
f3 = float(f1)**float(f2)
print(f3)
a, b = input().split()
print(int(a)//int(b))
a, b = input().split()
print(int(a)%int(b))
#방법 1
f = float(input())
print(round(f,2))
#방법2
a=float(input())
print(format(a, ".2f"))
#방법 1
a,b=input().split()
a=float(a)
b=float(b)
c=a/b
print('%.3f'%c)
#방법2
a,b=input().split()
a=float(a)
b=float(b)
c=a/b
print(format(c,".3f"))
a,b=input().split()
a=int(a)
b=int(b)
print(a+b)
print(a-b)
print(a*b)
print(a//b)
print(a%b)
print(round(a/b,2))
a, b, c = input().split()
a=int(a)
b=int(b)
c=int(c)
hap=a+b+c
avg=hap/3
print(hap, format(avg, ".2f"))
n = int(input())
print(n<<1)
a, b = input().split()
a = int(a)
b = int(b)
print(a<<b)
a, b = input().split()
a = int(a)
b = int(b)
print(a<b)
a, b = input().split()
a = int(a)
b = int(b)
print(a==b)
a, b = input().split()
a = int(a)
b = int(b)
print(a<=b)
a, b = input().split()
a = int(a)
b = int(b)
print(a!=b)
n = int(input())
print(bool(n))
a = bool(int(input()))
print(not a)
a, b = input().split()
print(bool(int(a)) and bool(int(b)))
a, b = input().split()
print(bool(int(a)) or bool(int(b)))
a, b = input().split()
c = bool(int(a))
d = bool(int(b))
print((c and (not d)) or ((not c) and d))
# 방법1
a, b = input().split()
a = bool(int(a))
b = bool(int(b))
print((a and b) or (not a and not b))
# 방법2
a, b = input().split()
a = bool(int(a))
b = bool(int(b))
print(a==b)
# 방법1
a, b = input().split()
c= bool(int(a))
d= bool(int(b))
print( not (c or d) )
# 방법2
a, b = input().split()
c= bool(int(a))
d= bool(int(b))
print( c==False and d==False )
a=int(input())
print(~a)
a, b = input().split()
print(int(a) & int(b))
a, b = input().split()
print(int(a) | int(b))
a, b = input().split()
print(int(a) ^ int(b))
C : True 또는 False 를 평가할 조건식(conditional expression) 또는 값
x : C의 평가 결과가 True 일 때 사용할 값
y : C의 평가 결과가 True 가 아닐 때 사용할 값
a, b = input().split()
a = int(a)
b = int(b)
c = a if a>=b else b
print(c)
#방법1
a, b, c = input().split()
a = int(a) #변수 a에 저장되어있는 값을 정수로 바꾸어 다시 변수 a에 저장
b = int(b)
c = int(c)
d = a if a<b else b
e = d if d<c else c
print(e)
#내 방법
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
print(int((b if b<c else c) if a>b else (a if a<c else c)))
a, b, c = input().split()
a=int(a)
b=int(b)
c=int(c)
if a%2==0:
print(a)
if b%2==0:
print(b)
if c%2==0:
print(c)
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
if a%2==0:
print("even")
else:
print("odd")
if b%2==0:
print("even")
else:
print("odd")
if c%2==0:
print("even")
else:
print("odd")
n=int(input())
if n<0:
if n%2==0:
print('A')
else:
print('B')
else:
if n%2==0:
print('C')
else:
print('D')
a=int(input())
if a>=90:
print("A")
elif a>=70:
print("B")
elif a>=40:
print("C")
else:
print("D")
a=input()
if a=='A':
print("best!!!")
elif a=='B':
print("good!!")
elif a=='C':
print("run!")
elif a=='D':
print("slowly~")
else:
print("what?")
a=int(input())
if a//3==1:
print("spring")
elif a//3==2:
print("summer")
elif a//3==3:
print("fall")
else:
print("winter")
조건식을 평가한다.
True 인 경우 코드블록을 실행한다.
다시 조건식을 평가한다.
True 인 경우 코드블록을 실행한다.
...
... 조건식의 평가 값이 False 인 경우 반복을 중단하고, 그 다음 명령을 실행한다.
조건식의 평가 결과가 True 동안만 반복 실행된다.
while True:
a=input()
a=int(a)
if a==0:
break
else:
print(a)
a=int(input())
while a!=0:
print(a)
a=a-1
a=int(input())
while a!=0:
a=a-1
print(a)
c=input()
i = ord('a')
c = ord(c)
while i<=c:
print(chr(i), end=' ')
i+=1
n=int(input())
i=0
while i<=n:
print(i)
i+=1
n=int(input())
for i in range(n+1):
print(i)
n = int(input())
sum=0
for i in range(1, n+1):
if i%2==0:
sum=sum+i
print(sum)
while True:
x=input()
print(x)
if x=='q':
break
n = int(input())
s = 0
t = 0
while s<n :
t = t+1
s = s+t
print(t)
n,m=input().split()
n=int(n)
m=int(m)
for i in range(1, n+1) :
for j in range(1, m+1) :
print(i, j)
n = int(input(), 16)
for i in range(1, 16) :
print('%X'%n, '*%X'%i, '=%X'%(n*i), sep='')
'''
또는
print("%X*%X=%X"%(n,i,n*i))
'''
n = int(input())
for i in range(1, n+1) :
if i%10==3 or i%10==6 or i%10==9 :
print("X", end=' ')
else :
print(i, end=' ')
r, g, b = input().split()
r = int(r)
g = int(g)
b = int(b)
for i in range(0, r) :
for j in range(0, g) :
for k in range(0, b) :
print(i, j, k)
print(r*g*b)
h, b, c, s = input().split()
h = int(h)
b = int(b)
c = int(c)
s = int(s)
print(round(h*b*c*s/8/1024/1024, 1), "MB")
w,h,b = input().split()
res=int(w)*int(h)*int(b)/1024/1024/8
print('%.2f'%res,"MB")
a=int(input())
s=0
c=0
while True:
s=s+c
c=c+1
if s>=a:
break
print(s)
n=int(input())
for i in range(1, n+1) :
if i%3==0 :
continue #다음 반복 단계로 넘어간다.
print(i, end=' ') #i가 짝수가 아닐 때만 실행된다.
a,d,n=input().split()
a=int(a)
d=int(d)
n=int(n)
s=a
for i in range(2, n+1):
s+=d
print(s)
a, r, n = input().split()
a = int(a)
r = int(r)
n = int(n)
for i in range(1, n) :
a = a*r
print(a)
a, m, d, n = input().split()
a = int(a)
m = int(m)
d = int(d)
n = int(n)
for i in range(1, n) :
a = a*m+d
print(a)
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
d = 1
while d%a!=0 or d%b!=0 or d%c!=0 :
d += 1
print(d)
n = int(input())
a = input().split()
for i in range(n) :
a[i] = int(a[i])
d = []
for i in range(24) :
d.append(0)
for i in range(n) :
d[a[i]] += 1
for i in range(1, 24) :
print(d[i], end=' ')
n = int(input())
a = input().split()
for i in range(n) :
a[i] = int(a[i])
for i in range(n-1, -1, -1):
print(a[i], end=' ')
n = int(input())
a = input().split()
for i in range(n) :
a[i] = int(a[i])
min = a[0]
for i in range(0, n) :
if a[i] < min :
min = a[i]
print(min)
d=[]
for i in range(20) :
d.append([])
for j in range(20) :
d[i].append(0)
n = int(input())
for i in range(n) :
x, y = input().split()
d[int(x)][int(y)] = 1
for i in range(1, 20) :
for j in range(1, 20) :
print(d[i][j], end=' ')
print()
d=[]
for i in range(20) :
d.append([])
for j in range(20) :
d[i].append(0)
for i in range(19) :
a = input().split()
for j in range(19) :
d[i+1][j+1] = int(a[j])
n = int(input())
for i in range(n) :
x,y=input().split()
x=int(x)
y=int(y)
for j in range(1, 20) :
if d[j][y]==0 :
d[j][y]=1
else :
d[j][y]=0
if d[x][j]==0 :
d[x][j]=1
else :
d[x][j]=0
for i in range(1, 20) :
for j in range(1, 20) :
print(d[i][j], end=' ')
print()
h,w = input().split()
h = int(h)
w = int(w)
m = []
for i in range(h+1) :
m.append([])
for j in range(w+1) :
m[i].append(0)
n = int(input())
for i in range(n) :
l,d,x,y = input().split()
if int(d)==0 :
for j in range(int(l)) :
m[int(x)][int(y)+j] = 1
else :
for j in range(int(l)) :
m[int(x)+j][int(y)] = 1
for i in range(1, h+1) :
for j in range(1, w+1) :
print(m[i][j], end=' ')
print()
m=[]
for i in range(12) :
m.append([])
for j in range(12) :
m[i].append(0)
for i in range(10) :
a=input().split()
for j in range(10) :
m[i+1][j+1]=int(a[j])
x = 2
y = 2
while True :
if m[x][y] == 0 :
m[x][y] = 9
elif m[x][y] == 2 :
m[x][y] = 9
break
if (m[x][y+1]==1 and m[x+1][y]==1) or (x==9 and y==9) :
break
if m[x][y+1] != 1 :
y += 1
elif m[x+1][y] != 1 :
x += 1
for i in range(1, 11) :
for j in range(1, 11) :
print(m[i][j], end=' ')
print()