fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. System.out.println("Кофе-машина");
  10.  
  11. int moneyAmount = 90;
  12.  
  13. int espressoPrice = 80;
  14. int cappucinoPrice = 160;
  15. int waterPrice = 10;
  16.  
  17.  
  18.  
  19. if(moneyAmount >= espressoPrice) {
  20. System.out.println("Вы можете купить эспрессо");
  21.  
  22.  
  23.  
  24. if(moneyAmount >= cappucinoPrice) {
  25. System.out.println("Вы можете купить капучино");
  26.  
  27.  
  28.  
  29. if(moneyAmount >= waterPrice) {
  30. System.out.println("Вы можете купить воду");
  31.  
  32. }
  33.  
  34. }
  35.  
  36. }else
  37. {
  38. System.out.println("Не хватает денег");
  39. }
  40.  
  41.  
  42. }
  43. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
Кофе-машина
Вы можете купить эспрессо