4.Sum of Chars - Java
Здравейте!
Бихте ли ми помогнали с решението на следната задача:
Write a program, which sums the ASCII codes of n characters and prints the sum on the console.
Input
·On the first line, you will receive n – the number of lines, which will follow
·On the next n lines – you will receive letters from the Latin alphabet
Output
Print the total sum in the following format:
The sum equals: {totalSum}
Constraints
·n will be in the interval [1…20].
·The characters will always be either upper or lower-case letters from the English alphabet
·You will always receive one letter per line
Examples
Input |
Output |
Input |
Output |
|
5 A b C d E |
The sum equals: 399 |
12 S o f t U n i R u l z z |
The sum equals: 1263 |
https://pastebin.com/PVH8pGH8
Благодаря!