Advertisement
Spocoman

Wedding Party

Sep 10th, 2024
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int guests = Integer.parseInt(scanner.nextLine()),
  7.                 budget = Integer.parseInt(scanner.nextLine());
  8.         budget -= guests * 20;
  9.  
  10.         if (budget < 0) {
  11.             System.out.println("They won't have enough money to pay the covert. They will need "
  12.                     + Math.abs(budget) + " lv more.");
  13.         } else {
  14.             System.out.println("Yes! " + Math.round(0.40 * budget) + " lv are for fireworks and "
  15.                     + Math.round(0.60 * budget) + " lv are for donation.");
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement