/* package whatever; // don't place package name! */
import java.util.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main
(String[] args
) {
System.
out.
println("Кофе-машина"); Scanner scanner
= new Scanner
(System.
in); System.
out.
print("Внесите сумму"); int moneyAmount = scanner.nextInt();
scanner.close();
int espressoPrice = 100;
int cappucinoPrice = 200;
int waterPrice = 10;
int milkPrice = 50;
boolean canBuySomething = false;
if(moneyAmount >= milkPrice) {
System.
out.
println("Вы можете купить молоко"); canBuySomething = true;
}
if(moneyAmount >= espressoPrice) {
System.
out.
println("Вы можете купить эспрессо"); canBuySomething = true;
}
if(moneyAmount >= cappucinoPrice) {
System.
out.
println("Вы можете купить капучино"); canBuySomething = true;
}
if(moneyAmount >= waterPrice) {
System.
out.
println("Вы можете купить воду"); canBuySomething = true;
}
if(canBuySomething == false) {
System.
out.
println("Недостаточно средств. Учите джаву и идите работать!"); }
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwoKIAovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSAKCXsKCQlTeXN0ZW0ub3V0LnByaW50bG4oItCa0L7RhNC1LdC80LDRiNC40L3QsCIpOwoJCVNjYW5uZXIgc2Nhbm5lciA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkgICAgU3lzdGVtLm91dC5wcmludCgi0JLQvdC10YHQuNGC0LUg0YHRg9C80LzRgyIpOwogICAgICAgIGludCBtb25leUFtb3VudCA9IHNjYW5uZXIubmV4dEludCgpOwogICAgICAgIHNjYW5uZXIuY2xvc2UoKTsKCQlpbnQgZXNwcmVzc29QcmljZSA9IDEwMDsK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