Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Oscars {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String name = scanner.nextLine();
- double points = Double.parseDouble(scanner.nextLine());
- int juryNum = Integer.parseInt(scanner.nextLine());
- for (int i = 0; i < juryNum && points <= 1250.5; i++) {
- String juryName = scanner.nextLine();
- double currentPoints = Double.parseDouble(scanner.nextLine());
- points += juryName.length() * currentPoints / 2;
- }
- if (points > 1250.5) {
- System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!\n", name, points);
- } else {
- System.out.printf("Sorry, %s you need %.1f more!\n", name, 1250.5 - points);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement