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