난수(Random Number)
//난수(Random Number)
public class Exam_03 {
	public static void main(String[] args) {
		double d =Math.random(); // double형, 난수생성method
		//Math.random() : double값중 난수를 생성해주는데 0~1 사이의 숫자다. 
		System.out.println((int)(d * 10)); // 0~9사이의 난수 출력. 10을 곱하고 int로 casting하는 방법.
		System.out.println((int)(d * 3 + 1)); // 1~3사이의 난수 출력. 3까지니까 3을 곱하고, 최소값은 1부터니까 1을 더하고 int로 casting.
		System.out.println((int)(d*(37-24+1)+24));//24에서 37 난수
	}
	
	/*
======================================================================
원하는 난수 범위를 구하기 위해 적절한 연산과 형 변환이 필요
Math.random()*(최대 - 최소 + 1) +최소

⇒ 최대-최소+1 은 최소값과 최대값 사이의 갯수차? 를 위해서
⇒ 맨 마지막에 최소를 더하는 이유는 랜덤수의 시작값을 위해서

정수형으로 나오려면 Casting을 해줘야함
(int)(Math.random()*(최대-최소+1)+최소
======================================================================
(원하는 범위에서 난수를 구하기 위한 공식)
최소 :x        최대 :y
random * (y-x+1)+x
======================================================================

	 * 
	 */
	
}