/* 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("Кофе-машина");
boolean canBuyAnything = false;
int moneyAmount = 100;
String[] drinks
= {"капучино",
"эспрессо",
"латте",
"вода",
"молоко"}; int[] prices = {60, 80, 150, 20, 30};
for( int i = 0; i < 5; i = i + 1)
{
if(moneyAmount >= prices[i])
{
System.
out.
println("Вы можете купить" + " " + drinks
[i
]); canBuyAnything = true;
}
}
if(canBuyAnything == false) {
System.
out.
println("Недостаточно средств!"); }
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVN5c3RlbS5vdXQucHJpbnRsbigi0JrQvtGE0LUt0LzQsNGI0LjQvdCwIik7CgkJCgkJYm9vbGVhbiBjYW5CdXlBbnl0aGluZyA9IGZhbHNlOwoJCQoJCWludCBtb25leUFtb3VudCA9IDEwMDsKCQkKCQlTdHJpbmdbXSBkcmlua3MgPSB7ItC60LDQv9GD0YfQuNC90L4iLCAi0Y3RgdC/0YDQtdGB0YHQviIsICLQu9Cw0YLRgtC1IiwgItCy0L7QtNCwIiwgItC80L7Qu9C+0LrQviJ9OwoJCWludFtdIHByaWNlcyA9IHs2MCwgODAsIDE1MCwgMjAsIDMwfTsKIAoJCWZvciggaW50IGkgPSAwOyBpIDwgNTsgaSA9IGkgKyAxKQoJC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