Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class nested {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int kozunaci = Integer.parseInt(scanner.nextLine());
- int points = 0;
- int max = Integer.MIN_VALUE;
- for (int i = 0; i < kozunaci; i++) {
- String baker = scanner.nextLine();
- if(baker.equals("Stop")){
- System.out.printf("%s has %d points.%n");
- System.out.printf("%s is the new number 1!%n");
- System.out.printf("%s has %d points.%n");
- System.out.printf("%s won competition with %d points!");
- }else {
- while (true) {
- int pointsFromOnePerson = Integer.parseInt(scanner.nextLine());
- points += pointsFromOnePerson;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement