Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class nested {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int kozunaci = Integer.parseInt(scanner.nextLine());
  7. int points = 0;
  8. int max = Integer.MIN_VALUE;
  9. for (int i = 0; i < kozunaci; i++) {
  10. String baker = scanner.nextLine();
  11. if(baker.equals("Stop")){
  12. System.out.printf("%s has %d points.%n");
  13. System.out.printf("%s is the new number 1!%n");
  14. System.out.printf("%s has %d points.%n");
  15. System.out.printf("%s won competition with %d points!");
  16. }else {
  17. while (true) {
  18. int pointsFromOnePerson = Integer.parseInt(scanner.nextLine());
  19. points += pointsFromOnePerson;
  20. }
  21.  
  22. }
  23. }
  24. }
  25.  
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement