* 커피의 가격은 3000 원 이다.

* 커피의 수량과 지불 금액을 입력받아서 거스름 돈 또는 추가 지불 금액을 구하라.

 

import java.util.Scanner;

public class coffee_order {

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

		Scanner sc= new Scanner(System.in);    //System.in is a standard input stream  
		System.out.print("아메리카노 수량을입력하시오 :");  
		coffice_count	= sc.nextLong();
		
		System.out.print("지불금액을 입력하시오 :");
		paid_price	= sc.nextLong();

		long total_price	=	0;
		total_price	=	coffice_price * coffice_count;
		System.out.println("아메리카노 " + coffice_count + " 개는 " + total_price + " 원 입니다.");
		
		long refund_price	=	paid_price - total_price;
		
		if( refund_price == 0 )
		{
			System.out.println(" 정확히 지불 되었습니다. ");
		}else{
			if( refund_price > 0 )
			{
				System.out.println("거스름돈은 " + refund_price + " 입니다.");
			}else {
				System.out.println( ( refund_price * -1 ) + " 원을 추가지불해 주세요.");
			}			
		}
		


		
	}

}