백준 #31561번 시계탑

jhj·2024년 5월 20일

백준 JAVA

목록 보기
479/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		double m = sc.nextDouble();
		if(0 <= m && m <= 30) {
			System.out.println(String.format("%.1f", m / 2));
		}else {
			System.out.println(String.format("%.1f", (m - 30) / 2 * 3 + 15));
		}
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글