BIG

3과 5의 공배수 입력시 "빙고" 출력
( Example_"Bingo" output when inputting common multiples of 3 and 5 )

 

import java.util.Scanner;

public class common_multiple_of_3_and_5 {

	public static long inputNumber	=	0;
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		while(true)
		{
			Scanner sc= new Scanner(System.in);    //System.in is a standard input stream  
			System.out.print("1~9999 사이 정수를 입력하시오 :");  
			inputNumber	= sc.nextLong();

			
			long chkVal_01	=	inputNumber % 3;
			long chkVal_02	=	inputNumber % 5;
			
			
			if((chkVal_01 == 0)&&(chkVal_02 == 0))
			{
				System.out.println("빙고");
			}else {
				System.out.println("다시입력하세요.");
			}
		}
	}

}
LIST