fork download
  1. <?php
  2.  
  3. print("Кофе-машина\n");
  4.  
  5. $moneyAmount = 40;
  6.  
  7. $cappucinoPrice = 200;
  8. $espressoPrice = 100;
  9. $mochaPrice = 80;
  10. $chocolatePrice = 20;
  11. $waterPrice = 50;
  12.  
  13. if ($moneyAmount >= $cappucinoPrice) {
  14. print("Вы можете купить капучино\n");
  15. }
  16.  
  17. if ($moneyAmount >= $espressoPrice) {
  18. print("Вы можете купить эспрессо\n");
  19. }
  20.  
  21. if ($moneyAmount >= $mochaPrice) {
  22. print("Вы можете купить моккачино\n");
  23. }
  24.  
  25. if ($moneyAmount >= $chocolatePrice) {
  26. print("Вы можете купить шоколадку\n");
  27. }
  28.  
  29. if ($moneyAmount >= $waterPrice) {
  30. print("Вы можете купить воду\n");
  31. }
Success #stdin #stdout 0.03s 25740KB
stdin
Standard input is empty
stdout
Кофе-машина
Вы можете купить шоколадку