Advertisement
Spocoman

04. Sum of Chars

Jan 18th, 2022
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2.  
  3. namespace 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.                 sum += char.Parse(Console.ReadLine());
  15.             }
  16.             Console.WriteLine($"The sum equals: {sum}");
  17.         }
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement