Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String destination = scanner.nextLine();
- while (!destination.equals("End")) {
- int minBudget = Integer.parseInt(scanner.nextLine());
- int savings = 0;
- while (savings < minBudget) {
- int money = Integer.parseInt(scanner.nextLine());
- savings = savings + money;
- }
- System.out.printf("Going to %s!%n", destination);
- destination = scanner.nextLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment