Advertisement
Spocoman

06. Oscars

Aug 27th, 2024 (edited)
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Oscars {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         String name = scanner.nextLine();
  7.         double points = Double.parseDouble(scanner.nextLine());
  8.         int juryNum = Integer.parseInt(scanner.nextLine());
  9.  
  10.         for (int i = 0; i < juryNum && points <= 1250.5; i++) {
  11.             String juryName = scanner.nextLine();
  12.             double currentPoints = Double.parseDouble(scanner.nextLine());
  13.  
  14.             points += juryName.length() * currentPoints / 2;
  15.         }
  16.  
  17.         if (points > 1250.5) {
  18.             System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!\n", name, points);
  19.         } else {
  20.             System.out.printf("Sorry, %s you need %.1f more!\n", name, 1250.5 - points);
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement