Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Shavit Borisov
- // CW
- import java.util.Scanner;
- public class MaccabiTelAviv {
- public static void main(String[] args)
- {
- Scanner in = new Scanner (System.in);
- int playersQuantity, bestPlayer = 0, points, maxPoints = 0;
- System.out.print("How many players are there in Maccabi Tel Aviv BC? ");
- playersQuantity = in.nextInt();
- for(int i = 1; i <= playersQuantity; i++)
- {
- System.out.printf("How many points did player number %d make this season? ", i);
- points = in.nextInt();
- if(points > maxPoints)
- {
- maxPoints = points;
- bestPlayer = i;
- }
- }
- System.out.printf("The best player this season was player number %d, who scored %d points!", bestPlayer, maxPoints);
- in.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement