Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _04SumOfChars
- {
- class Program
- {
- static void Main(string[] args)
- {
- var input = int.Parse(Console.ReadLine());
- int totalSum = 0;
- int digit = 0;
- for (int i = 1; i <= input; i++)
- {
- string letter = Console.ReadLine();
- digit = letter[0];
- totalSum += digit;
- }
- Console.WriteLine($"The sum equals: {totalSum}");
- }
- }
- }
Add Comment
Please, Sign In to add comment