Advertisement
Spocoman

Oscars

Sep 8th, 2024
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 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.         String name = scanner.nextLine(), judgeName;
  7.         double points = Double.parseDouble(scanner.nextLine()),
  8.                 judgePoints;
  9.         int juryNum = Integer.parseInt(scanner.nextLine());
  10.  
  11.         for (int i = 0; i < juryNum; i++) {
  12.             judgeName = scanner.nextLine();
  13.             judgePoints = Double.parseDouble(scanner.nextLine());
  14.             points += judgeName.length() * judgePoints / 2;
  15.             if (points > 1250.5) {
  16.                 break;
  17.             }
  18.         }
  19.  
  20.         if (points > 1250.5) {
  21.             System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!\n", name, points);
  22.         } else {
  23.             System.out.printf("Sorry, %s you need %.1f more!\n", name, 1250.5 - points);
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement