Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- while (true) {
- $saveMoney = 0;
- $destination = readline();
- if ($destination == "End") {
- break;
- }
- $budget = intval(readline());
- while (true) {
- $saveMoney += intval(readline());
- if ($saveMoney >= $budget) {
- echo "Going to $destination!" . PHP_EOL;
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement