본문 바로가기

코딩테스트/프로그래밍 기초 | 입출력

[코드트리] 특정 문자를 사이에 두고 입력

1시간 뒤 시간 출력

https://www.codetree.ai/missions/4/problems/print-one-hour-later?&utm_source=clipboard&utm_medium=text

t = input()
new_t = (t.split(":"))
h = int(new_t[0])+1
print(str(h)+":"+new_t[1])

 

 

 

 

날짜 변경하여 출력 2

https://www.codetree.ai/missions/4/problems/print-date-with-different-format-2?&utm_source=clipboard&utm_medium=text

d = input()
new_d = d.split("-")
print(new_d[2]+"."+new_d[0]+"."+new_d[1])

 

 

 

 

입력받아 출력 2

https://www.codetree.ai/missions/4/problems/input-and-output-2?&utm_source=clipboard&utm_medium=text

j = input()
new_j = j.split("-")
print(new_j[0]+new_j[1])

 

 

 

 

날짜 변경하여 출력

https://www.codetree.ai/missions/4/problems/print-date-with-different-format?&utm_source=clipboard&utm_medium=text

d = input()
new_d = d.split(".")
print(new_d[1]+"-"+new_d[2]+"-"+new_d[0])

 

 

 

 

전화번호 바꾸기

https://www.codetree.ai/missions/4/problems/change-phone-number?&utm_source=clipboard&utm_medium=text

n = input()
new_n = n.split("-")
print(new_n[0]+"-"+new_n[2]+"-"+new_n[1])