자바_기초
자바기초)Variable + 값입력 기초문제3
잠수콩
2019. 5. 14. 08:35
import java.util.*;
public class exam3_Variable3 {
public static void main(String[] args) {
// 날 수를 입력받아 이 날수에 해당하는 기간은 모두 몇 초인지 계산하세요.
// 초 계산은 “날수 * 24 * 60 * 60” 로 하면 됩니다.
// 사용하는 변수는
// days #날수
// seconds #초단위 시간
System.out.println("날 수를 입력하세요.");
Scanner sc = new Scanner(System.in);
int days = sc.nextInt();
long seconds;
seconds = days * 24 * 60 * 60;
System.out.println("계산된 초수는 " + seconds + "초 입니다.");
}
}