https://www.acmicpc.net/problem/5554
5554번: 심부름 가는 길
승균이는 매일 학교, PC방, 학원에 다닌다. 반복되는 일상에 익숙해진 승균이는 이동시간을 단축해서 PC방에 더 오래 머물고 싶었다. 그래서 스톱워치를 들고 이동할 때마다 기록을 잰 후 집
www.acmicpc.net
풀이
#include <stdio.h>
int main() {
int hts, stp, pta, ath;
int total = 0;
scanf("%d", &hts); // home to school
scanf("%d", &stp); // school to pc
scanf("%d", &pta); // pc to academy
scanf("%d", &ath); // academy to home
total = hts + stp + pta + ath;
printf("%d\n", total / 60); // 분
printf("%d\n", total % 60); // 초
return 0;
}
'코딩 > 백준 문제 (브론즈)' 카테고리의 다른 글
[백준/5524/C언어] 입실 관리 _ 풀이 (0) | 2023.08.17 |
---|---|
[백준/5523/C언어] 경기 결과 _ 풀이 (0) | 2023.08.17 |
[백준/1408/C언어] 24 _ 풀이 (0) | 2023.08.16 |
[백준/10817/C언어] 세 수 _ 풀이 (0) | 2023.08.16 |
[백준/2440/C언어] 별 찍기 - 3 _ 풀이 (0) | 2023.08.16 |