Search

변수3_개념02_시간

대분류
STEP01 프로그램설치/기초/산술/변수
문제 난이도
수학
소분류
변수3_개념

영상

개념

<script> /* [개념] 시간 계산 1시간 = 60분 = 3600초(60분 * 60초) 1분 = 60초 1초 */ /* [문제1] 4000초를 시간만 출력하시오. 4000초를 시간을 제외하고 분만 출력하시오. 4000초를 시간을 제외하고 초만 출력하시오. */ let 총시간 = 4000; let 시 = parseInt(총시간 / 3600); let 분 = parseInt(총시간 % 3600 / 60); let 초 = 총시간 % 60; console.log(); console.log(); console.log(); document.write(+ "<br>"); document.write(+ "<br>"); document.write(+ "<br>"); /* [문제2] 123123초를 시간만 출력하시오. 123123초를 시간을 제외하고 분만 출력하시오. 123123초를 시간을 제외하고 초만 출력하시오. */ 총시간 = 123123;= parseInt(총시간 / 3600);= parseInt(총시간 % 3600 / 60);= 총시간 % 60; console.log(); console.log(); console.log(); document.write(+ "<br>"); document.write(+ "<br>"); document.write(+ "<br>"); </script>
Java
복사