Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public class main {
  2.  
  3. public static void main(String[] args)
  4. {
  5. int moneyAmount = 100;
  6.  
  7. String drinks[] = {
  8. "капучино", "латте", "вода", "молоко"
  9. };
  10.  
  11. int prices[] = {120,140,20};
  12.  
  13. System.out.println("Коффе-машинка");
  14.  
  15. for(int i = 0; i < 4; i++)
  16. {
  17. if(moneyAmount < prices[i])
  18. {
  19. System.out.println("У вас не хватает денег на покупку " + drinks[i]);
  20. }
  21. System.out.println(drinks[i]);
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement