본문 바로가기
ⓒⓞⓓⓘⓝⓖⓣⓔⓢⓣ/ⓟⓨⓣⓗⓞⓝ

[python] 단계별로 풀어보기 - 1단계

by heaven00 2021. 4. 22.
728x90

 

 

 

백준에 있는 단계별로 풀어보기 중 1단계

(내 기준) 난이도가 조금 낮다고 생각되는 것은 한번에 다 올릴 것이고,

조금 어렵게 느껴지고 안풀리면 그때부터는 한문제씩 풀고 올릴 예정

 

 


 

 

1단계는 간단한 입출력과 더하기, 빼기, 곱하기, 나누기, 나머지를 구하는 간단한 연산에 대한 내용이다

그래서 주석도 달지 않았다

 

 

 

 

1-1) 백준 2557번: Hello World

 

print("Hello World!")

 

 

 

 

1-2) 백준 10718번: We love kriii

 

print("강한친구 대한육군")
print("강한친구 대한육군")

 

 

 

 

1-3) 백준 10171번: 고양이

 

print('\    /\\')
print(" )  ( ')")
print('(  /  )')
print(' \(__)|')

 

 

 

1-4) 백준 10172번: 개

 

print("|\_/|")
print("|q p|   /}")
print("( 0 )\"\"\"\\")
print("|\"^\"`    |")
print("||_/=\\\__|")

 

 

 

 

1-5) 백준 1000번: A+B

 

a, b = input().split()
print(int(a) + int(b))

 

 

 

 

 

1-6) 백준 1001번: A-B

 

a, b = input().split()
print(int(a) - int(b))

 

 

 

 

1-7) 백준 10998번: A x B

 

a, b = input().split()
print(int(a) * int(b))

 

 

 

 

1-8) 백준 1008번: A / B

 

a, b = input().split()
print(int(a) / int(b))

 

 

 

 

1-9) 백준 10869번: 사칙연산

 

a, b = input().split()
print(int(a) + int(b))
print(int(a) - int(b))
print(int(a) * int(b))
print(int(a) // int(b))
print(int(a) % int(b))

 

 

 

 

1-10) 백준 10430번: 나머지

 

A, B, C = input().split()
a = int(A)
b = int(B)
c = int(C)
print((a+b)%c)
print(((a%c)+(b%c))%c)
print((a*b)%c)
print(((a%c)*(b%c))%c)

 

 

 

 

1-11) 백준 2588번: 곱셈

 

A = input()
B = input()

a = int(A)
b = int(B)

print(a*(b%10))
print(a*((b%100)//10))
print(a*((b//100)))
print(a*b)

 

 

 

 

 

728x90

댓글