Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass {
- public static void main(String args[]) {
- java.util.Scanner scanner = new java.util.Scanner(System.in);
- int participations = scanner.nextInt();
- int startingPoints = scanner.nextInt();
- String placing = null;
- int totalPoints = 0;
- int wins = 0;
- for (int i = 1; i <= participations; i++) {
- placing = scanner.next();
- switch(placing) {
- case "W" : totalPoints += 2000;wins++;break;
- case "F" : totalPoints += 1200; break;
- case "SF" : totalPoints += 720; break;
- default : totalPoints = totalPoints;
- }
- }
- System.out.printf("Final points: %d\n", totalPoints + startingPoints);
- System.out.printf("Average points: %.0f\n", Math.floor((double)totalPoints/participations));
- System.out.printf("%.2f%%", 100.00 * wins/participations);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement