/* 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("Кофе-машина");
// int moneyAmount = 12;
Scanner in
= new Scanner
(System.
in); System.
out.
printf("сколько внести? ",
/n
); int moneyAmount=in.nextInt();
System.
out.
println("Вы внесли " + moneyAmount
+ " руб.");
int cappucinoPrice = 150;
int americanoPrice = 65;
int waterPrice = 20;
int teaPrice = 80;
boolean canBuySomething = false;
if(moneyAmount >= cappucinoPrice) {
System.
out.
println("Вы можете купить капучино"); canBuySomething = true;
}
if(moneyAmount >= americanoPrice) {
System.
out.
println("Вы можете купить американо"); canBuySomething = true;
}
if(moneyAmount >= waterPrice) {
System.
out.
println("Вы можете купить воду"); canBuySomething = true;
}
if(moneyAmount >=teaPrice) {
System.
out.
println("Вы можете купить чай"); }
if(canBuySomething == false) {
System.
out.
println("Недостаточно средств :( Изучайте Java и зарабатывайте много!))"); }
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVN5c3RlbS5vdXQucHJpbnRsbigi0JrQvtGE0LUt0LzQsNGI0LjQvdCwIik7CgkJCgkvLwlpbnQgbW9uZXlBbW91bnQgPSAxMjsKCQoJCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCVN5c3RlbS5vdXQucHJpbnRmKC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