Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner key = new Scanner (System.in);
- int n = Integer.parseInt(key.nextLine());
- int sum = 0;
- while (n -- > 0) {
- sum += key.nextLine().charAt(0);
- }
- System.out.printf("The sum is %d", sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement