Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class main {
- public static void main(String[] args)
- {
- int moneyAmount = 100;
- String drinks[] = {
- "капучино", "латте", "вода", "молоко"
- };
- int prices[] = {120,140,20};
- System.out.println("Коффе-машинка");
- for(int i = 0; i < 4; i++)
- {
- if(moneyAmount < prices[i])
- {
- System.out.println("У вас не хватает денег на покупку " + drinks[i]);
- }
- System.out.println(drinks[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement