반응형
2588. 곱셈
import math
a = input()
b = input()
sum = 0
for index, i in enumerate(b[::-1]):
sum += math.pow(10, index) * (int(a) * int(i))
print(int(a) * int(i))
print(int(sum))
3046. R2
a, b = input().split()
print(2*int(b) - int(a))
2163. 초콜릿 자르기
a, b = input().split()
print((int(a)*int(b))-1)
11021. A+B -7
n = input()
answer = []
for i in range(int(n)):
a, b = input().split()
answer.append(int(a)+int(b))
for index, i in enumerate(answer):
print(f"Case #{index+1}: {i}")
11022. A+B - 8
n = input()
answer = []
list_a = []
list_b = []
for i in range(int(n)):
a, b = input().split()
answer.append(int(a)+int(b))
list_a.append(int(a))
list_b.append(int(b))
for index, i in enumerate(answer):
print(f"Case #{index+1}: {list_a[index]} + {list_b[index]} = {i}")
10699. 오늘 날짜
from datetime import datetime
print(datetime.strftime(datetime.now(), "%Y-%m-%d"))
2525. 오븐 시계
hour, minutes = input().split()
takes = input()
sum_min = int(minutes) + int(takes)
pass_value = sum_min // 60
spare_time = sum_min % 60
# print(pass_value, spare_time)
hour = (int(hour) + pass_value) % 24
print(hour, spare_time)
반응형
'TIL > Algorithm' 카테고리의 다른 글
[HackerRank] Subarray Division (0) | 2021.02.22 |
---|---|
[프로그래머스] 큰 수 만들기 (LV2) (0) | 2021.01.06 |
[프로그래머스] 키패드 누르기(easy, kakao) (0) | 2021.01.04 |
[프로그래머스] 크레인 인형뽑기 (easy, kakao) (0) | 2021.01.04 |
[프로그래머스] 실패율(easy, kakao) (0) | 2021.01.04 |