Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.*;
- public class Main {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int lines = Integer.parseInt(scan.nextLine());
- int sum = 0;
- for (int i = 0; i < lines; i++) {
- String chark = scan.nextLine();
- char znak = chark.charAt(0);
- int znakASCI = znak;
- sum +=znakASCI;
- }
- System.out.println("The sum equals: " + sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement