Advertisement
dragonbs

SumOfChars

Feb 2nd, 2023
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.22 KB | None | 0 0
  1. int count = int.Parse(Console.ReadLine());
  2.  
  3. int sum = 0;
  4. for (int i = 0; i < count; i++)
  5. {
  6.     int character = char.Parse(Console.ReadLine());
  7.     sum += character;
  8. }
  9.  
  10. Console.WriteLine($"The sum equals: {sum}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement