/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
System.
out.
println("Кофе-машина");
Scanner in
= new Scanner
(System.
in); System.
out.
println("Внесите деньги:"); int moneyAmount = in.nextInt();
// Cofee prices
int espressoPrice = 80;
int cappuccinoPrice = 150;
int milkPrice = 40;
int waterPrice = 20;
boolean isEnoughMoney = false;
if(moneyAmount >= espressoPrice)
{
System.
out.
println("Вы можете купить эспрессо."); isEnoughMoney = true;
}
if(moneyAmount >= cappuccinoPrice)
{
System.
out.
println("Вы можете купить капучино."); isEnoughMoney = true;
}
if(moneyAmount >= milkPrice)
{
System.
out.
println("Вы можете купить молоко."); isEnoughMoney = true;
}
if(moneyAmount >= waterPrice)
{
System.
out.
println("Вы можете купить воду."); isEnoughMoney = true;
}
if(!isEnoughMoney)
{
System.
out.
println("Нужно больше золота!"); }
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVN5c3RlbS5vdXQucHJpbnRsbigi0JrQvtGE0LUt0LzQsNGI0LjQvdCwIik7CgkKCQlTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQlTeXN0ZW0ub3V0LnByaW50bG4oItCS0L3QtdGB0LjRgtC1INC00LXQvdGM0LPQuDoiKTsKCQlpbnQgbW9uZXlBbW91bnQgPSBpb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