6001.
print("Hello")
6002.
print("Hello World")
6003.
print("Hello")
print("World")
#다른 방법
print("Hello\nWorld")
6004.
print("'Hello'")
6005.
print('"Hello World"')
6006.
print(""""!@#$%^&*()'""")
#다른 풀이
print('"!@#$%^&*()\'')
6007.
print('"C:\\Download\\\'hello\'.py"')
6008.
print('print("Hello\\nWorld")')
6009.
A = input()
print(A)
6010.
A=int(input())
print(A)
6011.
A=float(input())
print(A)
6012.

A=int(input())
B=int(input())
print(A)
print(B)
<다른 사람 풀이>
한 줄에서 print한다.
print(input() + "\n" + input())
6013.
A=input()
B=input()
print(B)
print(A)
#다른 풀이
A=input()
B=input()
print(B+'\n'+A)
6014.

print((input()+'\n')*3)
6015.
A,B=map(int,input().split())
print(A)
print(B)
#print(A+'\n'+B)는 A,B가 string이 아니어서 X
#한 줄로 쓰려면
#print(str(A) + '\n' + str(B))
6016.
A,B = input().split()
print(B + " " + A)
6017.
A=input()
print(A,A,A) #공백 기준으로 출력
6018.
A,B=input().split(':') #:기준으로 split
print(A,B, sep=':') #: 사이에 두고 출력
6019.
Year, Month, Date = input().split('.')
print(Date, Month, Year, sep='-')
6020.
A,B=input().split('-')
print(A+B)
6021.
A=input()
for i in range(len(A)):
print(A[i])
6021.
A=input()
print(A[0:2], A[2:4], A[4:])
6023.
A,B,C = input().split(':')
print(B)
6024.
A,B = input().split()
print(A+B)
6025.
A,B = map(int,input().split())
print(A+B)
6026.
A=float(input())
B=float(input())
print(A+B)
6027.
8진수 : %o
16진수 : %x
A=int(input())
print('%x'% A)
6028.
print('%X' % int(input()))
6029.
A=int(input(),16) #16진수로 저장
print('%o'%A) #8진수로 출력
6030.
n = ord(input())
print(n)
6031.
A = int(input())
print(chr(A))
6032.
A = int(input())
print(-A)
6033.
A=ord(input()) #아스키 코드로 바꾸기
print(chr(A+1))
6034.
A, B = map(int, input().split())
print(A-B)
6035.
A, B = map(float, input().split())
print(A*B)
6036.
A, B =input().split()
print(A*int(B))
6037.
n = int(input())
print(input() * n)
6038.
A,B=map(int,input().split())
print(A**B)
6039.
A,B=map(float,input().split())
print(A**B)
6040.
A,B=map(int,input().split())
print(A//B)
6041.
A,B=map(int,input().split())
print(A%B)
6042.
print(format(float(input()), ".2f"))
6043.
A,B = map(float, input().split())
print(format(A/B, ".3f"))
6044.
a, b = map(int, input().split())
c = format(a / b, ".2f")
print(f"{a + b}\n{a - b}\n{a * b}\n{a // b}\n{a % b}\n{c}")
6045.
A,B,C = map(int, input().split())
print(A+B+C, format((A+B+C)/3, ".2f"))
6046.
print(int(input()) * 2)
6047.
A,B = map(int, input().split())
print(A<<B)
6048.
A,B = map(int, input().split())
if(A<B):
print("True")
else:
print("False")
6049.
A,B = map(int, input().split())
if(A==B):
print("True")
else:
print("False")
6050.
A,B = map(int, input().split())
if(B>=A):
print("True")
else:
print("False")
'study > 알고리즘' 카테고리의 다른 글
[백준] 백준 11047 <동전 0> 파이썬 (그리디 알고리즘) (0) | 2024.04.09 |
---|---|
[알고리즘] 그리디 알고리즘이란? (0) | 2024.04.08 |
[파이썬] 파이썬 문법 정리 (1) | 2024.04.01 |
[프로그래머스] 코딩테스트 연습 <가장 가까운 같은 글자> (python) (0) | 2024.02.25 |
[프로그래머스] [PCCE 기출문제] 9번 이웃한 칸 (Python) (0) | 2024.02.25 |
6001.
print("Hello")
6002.
print("Hello World")
6003.
print("Hello")
print("World")
#다른 방법
print("Hello\nWorld")
6004.
print("'Hello'")
6005.
print('"Hello World"')
6006.
print(""""!@#$%^&*()'""")
#다른 풀이
print('"!@#$%^&*()\'')
6007.
print('"C:\\Download\\\'hello\'.py"')
6008.
print('print("Hello\\nWorld")')
6009.
A = input()
print(A)
6010.
A=int(input())
print(A)
6011.
A=float(input())
print(A)
6012.

A=int(input())
B=int(input())
print(A)
print(B)
<다른 사람 풀이>
한 줄에서 print한다.
print(input() + "\n" + input())
6013.
A=input()
B=input()
print(B)
print(A)
#다른 풀이
A=input()
B=input()
print(B+'\n'+A)
6014.

print((input()+'\n')*3)
6015.
A,B=map(int,input().split())
print(A)
print(B)
#print(A+'\n'+B)는 A,B가 string이 아니어서 X
#한 줄로 쓰려면
#print(str(A) + '\n' + str(B))
6016.
A,B = input().split()
print(B + " " + A)
6017.
A=input()
print(A,A,A) #공백 기준으로 출력
6018.
A,B=input().split(':') #:기준으로 split
print(A,B, sep=':') #: 사이에 두고 출력
6019.
Year, Month, Date = input().split('.')
print(Date, Month, Year, sep='-')
6020.
A,B=input().split('-')
print(A+B)
6021.
A=input()
for i in range(len(A)):
print(A[i])
6021.
A=input()
print(A[0:2], A[2:4], A[4:])
6023.
A,B,C = input().split(':')
print(B)
6024.
A,B = input().split()
print(A+B)
6025.
A,B = map(int,input().split())
print(A+B)
6026.
A=float(input())
B=float(input())
print(A+B)
6027.
8진수 : %o
16진수 : %x
A=int(input())
print('%x'% A)
6028.
print('%X' % int(input()))
6029.
A=int(input(),16) #16진수로 저장
print('%o'%A) #8진수로 출력
6030.
n = ord(input())
print(n)
6031.
A = int(input())
print(chr(A))
6032.
A = int(input())
print(-A)
6033.
A=ord(input()) #아스키 코드로 바꾸기
print(chr(A+1))
6034.
A, B = map(int, input().split())
print(A-B)
6035.
A, B = map(float, input().split())
print(A*B)
6036.
A, B =input().split()
print(A*int(B))
6037.
n = int(input())
print(input() * n)
6038.
A,B=map(int,input().split())
print(A**B)
6039.
A,B=map(float,input().split())
print(A**B)
6040.
A,B=map(int,input().split())
print(A//B)
6041.
A,B=map(int,input().split())
print(A%B)
6042.
print(format(float(input()), ".2f"))
6043.
A,B = map(float, input().split())
print(format(A/B, ".3f"))
6044.
a, b = map(int, input().split())
c = format(a / b, ".2f")
print(f"{a + b}\n{a - b}\n{a * b}\n{a // b}\n{a % b}\n{c}")
6045.
A,B,C = map(int, input().split())
print(A+B+C, format((A+B+C)/3, ".2f"))
6046.
print(int(input()) * 2)
6047.
A,B = map(int, input().split())
print(A<<B)
6048.
A,B = map(int, input().split())
if(A<B):
print("True")
else:
print("False")
6049.
A,B = map(int, input().split())
if(A==B):
print("True")
else:
print("False")
6050.
A,B = map(int, input().split())
if(B>=A):
print("True")
else:
print("False")
'study > 알고리즘' 카테고리의 다른 글
[백준] 백준 11047 <동전 0> 파이썬 (그리디 알고리즘) (0) | 2024.04.09 |
---|---|
[알고리즘] 그리디 알고리즘이란? (0) | 2024.04.08 |
[파이썬] 파이썬 문법 정리 (1) | 2024.04.01 |
[프로그래머스] 코딩테스트 연습 <가장 가까운 같은 글자> (python) (0) | 2024.02.25 |
[프로그래머스] [PCCE 기출문제] 9번 이웃한 칸 (Python) (0) | 2024.02.25 |