fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. System.out.println("Кофе-машина"); // your code goes here
  13.  
  14. int MoneyAmount = 250;
  15. System.out.println("Вы внесли " + MoneyAmount + " рублей");
  16.  
  17. int CappucinoPrice = 150;
  18. int EspressoPrice = 90;
  19. int WaterPrice = 20;
  20. int TeaPrice = 220;
  21.  
  22. if (MoneyAmount >= CappucinoPrice) {
  23. System.out.println("Вы можете приобрести Каппучино за " + CappucinoPrice + " рублей");
  24. }
  25. if (MoneyAmount >= EspressoPrice) {
  26. System.out.println("Вы можете приобрести Эспрессо за " + EspressoPrice + " рублей");
  27. }
  28. if (MoneyAmount >= WaterPrice) {
  29. System.out.println("Вы можете приобрести Воду за " + WaterPrice + " рублей");
  30. }
  31. if (MoneyAmount >= TeaPrice) {
  32. System.out.println("Вы можете приобрести Чай за " + TeaPrice + " рублей");
  33. }
  34. }
  35. }
Success #stdin #stdout 0.15s 52344KB
stdin
Standard input is empty
stdout
Кофе-машина
Вы внесли 250 рублей
Вы можете приобрести Каппучино за 150 рублей
Вы можете приобрести Эспрессо за 90 рублей
Вы можете приобрести Воду за 20 рублей
Вы можете приобрести Чай за 220 рублей