반응형
Notice
Recent Posts
Recent Comments
Link
목록2530 (1)
안경잡이 구루루
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/sSzeB/btr6PzQGQRv/sm8aJXAzCSs9oKrM2WiQ3k/img.png)
https://www.acmicpc.net/problem/2530 나: h, m, s = map(int,input().split(' ')) add = int(input()) s = s+ add while s >= 60: m +=1 s = s-60 while m >=60: h +=1 m = m-60 while h >=24: h = h-24 print(h,m,s) 완성된 코드는 위와 같습니다. h, m, s = map(int,input().split(' ')) add = int(input()) 띄어쓰기를 기준으로 변수를 받기위해 split() 함수를 이용했다. 이때 split 함수는 괄호 안의 값을 기준으로 문자열로 나누어 리스트에 저장하는 방식이다. 그래서 사칙연산을 하기위해서는 정수형으로 바꿔주는 map..
파이썬(Python)/문제풀이(백준,BaekJoon)
2023. 3. 30. 20:49