Study/code up
[codeup] 1026번 [기초-입출력] 시분초 입력받아 분 만 출력하기
1nfra
2018. 4. 6. 13:05
728x90
문제 설명
시간을 시:분:초 형태로 입력 받아
분 만 출력하는 프로그램을 작성해보자.
입력
시간이 [시:분:초]의 형태로 입력된다.
출력
분 만 출력한다. (단, 10보다 작은 경우 불필요한 0은 출력하지 않는다.)
int h, m, s;
scanf("%d:%d:%d", &h, &m, &s);
1 2 3 4 5 6 7 8 | #include <stdio.h> int main() { int a, b, c; scanf("%d:%d:%d", &a, &b, &c); printf("%d", b); } | cs |
728x90