|
|
back to boardon java accepted import java.io.IOException; import java.util.Scanner; public class Main { public static int rent = 100; public static void main(String[] args) throws IOException { Scanner scanner = new Scanner(System.in); int numberOfFriends = Integer.parseInt(scanner.nextLine()); int totalGuests = 2; for (int i = 0; i < numberOfFriends; i++) { String answer = scanner.nextLine(); if (answer.contains("+")){ totalGuests += 2; }else{ totalGuests++; } } if (totalGuests == 13){ totalGuests++; } int total = totalGuests*rent; System.out.println(total);
scanner.close(); } } |
|
|