Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class LettersSymbolsNumbers
- {
- static void Main()
- {
- long numberStrings = long.Parse(Console.ReadLine());
- long sumLetters = 0;
- long sumNumbers = 0;
- long sumSymbols = 0;
- //loop for the strings to N
- for (int strings = 0; strings < numberStrings; strings++)
- {
- string input = Console.ReadLine().ToLower().Replace(" ", String.Empty);
- //loop for the characters in the string
- for (int characters = 0; characters < input.Length; characters++)
- {
- char currentcharacter =(input[characters]);
- if (currentcharacter >= '0' && currentcharacter <= '9')
- {
- sumNumbers += (currentcharacter - '0') * 20;
- }
- else if (currentcharacter>='a' && currentcharacter<= 'z')
- {
- sumLetters += (currentcharacter - 'a' + 1) * 10;
- }
- else
- {
- sumSymbols += 200;
- }
- }
- }
- Console.WriteLine(sumLetters);
- Console.WriteLine(sumNumbers);
- Console.WriteLine(sumSymbols);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement