fork(2) 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 = 20;
  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. else {
  35. System.out.println("Недостаточно средств!");
  36. }
  37. }
  38. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
Кофе-машина
Вы можете купить воду