Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int guests = Integer.parseInt(scanner.nextLine()),
- budget = Integer.parseInt(scanner.nextLine());
- budget -= guests * 20;
- if (budget < 0) {
- System.out.println("They won't have enough money to pay the covert. They will need "
- + Math.abs(budget) + " lv more.");
- } else {
- System.out.println("Yes! " + Math.round(0.40 * budget) + " lv are for fireworks and "
- + Math.round(0.60 * budget) + " lv are for donation.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement