Teo_Yanchev

SumOfChars - C# -Fundamentals

Aug 19th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _4.SumOfChars
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. int sum = 0;
  11.  
  12. for (int i = 0; i < n; i++)
  13. {
  14. string letter = Console.ReadLine();
  15.  
  16. sum += Char.Parse(letter);
  17. }
  18. Console.WriteLine($"The sum equals: {sum}");
  19. }
  20. }
  21. }
  22.  
Add Comment
Please, Sign In to add comment