public class Main
{
public static void main(String[] args) {
System.out.println("Кофемашина");
int moneyAmount = 120;
int[] drinkPrices = {200, 100, 50, 75};
String[] drinkNames = {"капучино", "эспрессо", "воду", "молоко"};
boolean canBuyAnything = false;
int length = Math.min(drinkPrices.length, drinkNames.length);
for (int i = 0; i < length; i++) {
if (moneyAmount >= drinkPrices[i]) {
System.out.println("Вы можете купить " +
drinkNames[i]);
canBuyAnything = true;
}
}
if (!canBuyAnything) {
System.out.println("Недостаточно средств :( Изучайте Java и зарабатывайте много!))");
}
}
}